- Home /
Rigidbody rotation vs Transform rotation
If the rigidbody rotates is the transform.rotation effected? Are there 2 separate axis? The transform.rotation can tumble freely but the physics is applied to the rigidbody.rotation?
Answer by suruz@kento · Nov 20, 2011 at 10:11 AM
It Just a matter of how you change transform property of a gameObject.You can change transform with physics through rigidBody, or you can change it using animation component, even you can change it manually.End result is they all are effecting same transform property.
Answer by Peter G · Aug 22, 2011 at 01:35 AM
You are correct. If you modify the rotation using transform.rotation
the object will ignore collisions that might have occurred so that it can reach that rotation no matter what objects might be in the way.
When you assign a value to rigidbody.rotation
the object will be rotated from its current rotation to the assigned rotation, but it will be blocked by the physics engine if it can't make the rotation. Then it will be stopped somewhere between its old rotation and the rotation you assigned to it.
Sorry to cut in here.
Does this suggest it's safe to adjust a non kinematic rigid body using rigidbody.position and rigidbody.rotation and not mess the physics???? i.e. position/rotate the rigid body manually then have physics apply any alterations?
This is ok???
Cheers
Answer by Joshua · Aug 22, 2011 at 01:36 AM
When getting (reading the values) it's the same. The difference is that when you set the transform.position or rotation it will be applied at the end of the frame but for rigidbody.position or rotation it will be applied at the end of the next physics step.
I think that is the most important answer, because once you try to do two different rotations in the same step, that don't know from each other you will run into problems if you use rigidbody.rotation. I recommend to use transform rotation for every problem.
Answer by DGArtistsInc · Aug 22, 2011 at 01:29 AM
i dont quite understand what you mean but rigidbody is a component and transform is just its position, rotation, and size of an object in the 3d world. A component can be applied to an gameObject. But an gameObject is a mesh(or not) with certain transforms.