Posts by Elias Eloi • 21 points
1 post
-
2
votes1
answer122
viewsA: Simple doubt of C# in Unity
Use Mathf.Clamp to restrict the movement of the object. transform.position = new Vector3 (Mathf.Clamp(transform.position.x, -5f, 6f),transform.position.y, transform.position.z);…