- Home /
stuttering motion
So I'm trying to move an object along Z axis relative to another by a simple code:
object1.transform.position = new Vector3(object1.transform.position.x, object1.transform.position.y, object2.transform.position.z);
Problem is that object 1 is stuttering really badly. I duplicate object1 and parent it to object2 just to see the difference. The parented object doesn't stutter at all obviously, so this lets me to believe that it has to do with the way it's coded? Is there a way to fix this problem? any help would be great.
Comment
Answer by DoctorMoney · Jun 20, 2014 at 02:01 AM
It's been a while since I've coded anything, but you could try
object1.transform.Translate(Vector3.forward) //or any direction you need it to go
Your answer
![](https://koobas.hobune.stream/wayback/20220613152006im_/https://answers.unity.com/themes/thub/images/avi.jpg)