- Home /
Freeze child from moving up / down
Hi,
I have a cube child of my camera 1 unit in front, what I'd like to do is stop the cube moving up/down when I look up/down but I want the cube to rotate around with the camera when I look around, how would I do that?
I'm not using rigid body.
Thanks.
Comment
Some unknowns here. Assu$$anonymous$$g the camera is stationary, you can just have the cube save it's 'y' position each frame. $$anonymous$$ake sure the camera code is updated in LateUpdate(). If the camera can move, then you have to set the 'y' height based on an offset from the camera 'y'.