Hi, I have a tank-like character, where the bottom part can move freely and the top part can rotate to follow whatever point the mouse is over. Currently, I'm using a single placeholder model that just rotates as a whole while it moves (I'm not sure if this is relevant!). The problem is, the closer the lookAt point gets to the model, the more the model jitters as it moves. This seems to only be noticeable when the model is moving.
Here is my code:
var ray = Camera.main.ScreenPointToRay (Input.mousePosition); var hit : RaycastHit; if (Physics.Raycast (ray, hit, 100)) var lookAtPos : Vector3 = hit.point; lookAtPos.y = transform.position.y; transform.LookAt(lookAtPos);