I have a game where i move a cube with a ray cast that hits the cube and ‘picks’ it up(makes cube kinematic and parented to camera). However the cube has to stay upright. It will tip over if I look up to far. How can I make it so that the cube is always upright? Like when I pick it up it is upright constantly but when it is down it is affected by physic normally. I have tried locking rotation but that does nothing.
Code, if required can be given.
Thanks in advance.