- Home /
Rotating a Kinematic Object
I have a Kinematic object, being moved by transform.translate. I would like to have the object spin while it moves, without affecting the actual movement. AddTorque doesn't work for Kinematic and using transform.rotate() affects the path that the object takes. Any ideas? Thanks!
Note: I move the object with transform.Translate(Vector3.down * amtToMove); So I think I want to spin/rotate the object, without affecting where the axis points, if that makes sense.
Answer by 3dDude · Dec 13, 2010 at 11:20 PM
you have to use world space like so:
transform.Rotate(Vector3.up, Time.deltaTime, Space.World);
transform.rotate docs:
http://unity3d.com/support/documentation/ScriptReference/Transform.Rotate.html
hope this helps!
Almost... Here is how I move the object: transform.Translate(Vector3.down * amtTo$$anonymous$$ove);
If I use your code, with Vector right, it will eventually cause the down axis to point up... is there anyway to spin on the Right axis?
yeah just change it to transform.Rotate(Vector3.right, Time.deltaTime, Space.World);
simple :)
I did, the down axis moves due to the rotate, even if set Space.World. I'm thinking I need to make an empty GameObject and have it as its child, so I can move the Parent and spin the child.
hmm I'm not really sure what your saying... could you explain better?
I created an empty GameObject and made the original object (which I wanted to spin) a child. Now I just move the parent (the Empty) and spin the child.
Your answer
Follow this Question
Related Questions
Picking up physical objects 1 Answer
Make sphere rotate when controlled 7 Answers
Constant Force doesn't work 0 Answers
Does gravity affect kinematic objects? 2 Answers
Compute the torque needed to rotate an object at a constant rate 3 Answers