- Home /
Keeping relative motion after rotation
I have an object A (a kinect controlled figure) parented to camera B. I need A to stay in the same relative position (with the same relative motion) to the camera when rotating - aka if the figure is in front of camera, moving towards it and you rotate the mouse 180 degrees the figure is still in front of the camera, moving towards it.
I've got it working thus far by simply using transform.RotateAround to move the figure. This moves the figure to the correct position, but fails in other ways. It does not change the figures rotation and more importantly, it also fails to change any movement of the figure.
For example, if I start the program and the player steps forward, they move one step towards the camera. This is the desired behaviour. However, if I spin the mouse 180 degrees my transform.rotateAround will move the figure to the right spot, but if the player then takes a step forward, the figure moves a step away from the camera, as all it see's is the command "move your localPosition by 1". In this case, no matter what position I've moved my figure to, I'd want a step towards the Kinect to register as "move one step towards the camera", while a step back would be "move away" etc. Can anyone tell me how to approach this? Much obliged :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613140429im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
OpenNI Zigfu Kinect problem 1 Answer
How to map MS Kinect SDK Bone Rotation data to Unity rigged character? 0 Answers
Rotating, stopping, rotating again. 2 Answers
Flip over an object (smooth transition) 3 Answers
Problem with oscillation 3 Answers