Posts by Pedro Prata • 39 points
4 posts
-
1
votes0
answers46
viewsQ: How to round position in Unity
My object moves by the keys A,D,W,S. It moves 1 in 1. However, this position is not always round, and can vary from 1.5 to 1.900 and this hinders the collision. Is there a command to round…
unity-5asked Pedro Prata 39 -
1
votes1
answer299
viewsQ: What is the default value of a primitive type variable in C#?
When a primitive type variable is created but not initialized its value is null? Example: public int x; If I don’t do anything with x, which means I don’t assign a value to it, it will be null?…
-
0
votes0
answers15
viewsQ: Find objects by a variable value with Findobjectsoftype
The command FindObjectsOfType can find objects by a specific type. I wonder if it can find objects by a variable value. For example: Find objects that have the variable x with a value of 10.…
unity3dasked Pedro Prata 39 -
1
votes1
answer565
viewsQ: Unity, how to move a cube so that it always walks 1 in 1
I’m creating a learning game in Unity (C#),made this code to move my player from one to one square using System.Collections; using System.Collections.Generic; using UnityEngine; // Esta classe é…
unity3dasked Pedro Prata 39