Quantcast
Channel: Answers for "How To Limit A transform MOVEMENT in X axis"
Browsing latest articles
Browse All 5 View Live

Answer by CodeMasterMike

I think that it jerks because you translate it, check if its out of limits, and if it is out of limits, you move it back to within the limits the next frame. Better way to do it, is to check the final...

View Article



Answer by criptoonita

Maybe clamp would be more elegant to make limits transform.position = Vector3(Mathf.Clamp(pObject.x, min, max), pObject.y, pObject.z);...

View Article

Answer by iuripujol

using System.Collections; using System.Collections.Generic; using UnityEngine; public class Move : MonoBehaviour { public Transform cube; public float dist2; Vector3 initPos; // Use this for...

View Article
Browsing latest articles
Browse All 5 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>