- Home /
Control Collider Rotation independently from the object it is attached to.
I need a way to freeze the rotation of the Collider/Rigidbody on my character, without freezing the rotation of the object that they are attached to. The object they are attached to is rotated with the mouse, but I DON'T want the mouse to also rotate the collider, because when the object hits things what happens will be affected by the mouse movement at the time of impact.
Basically I need to apply this script:
Update () {
transform.rotation = Quaternion.identity;
}
To the collider but not the object it is attached to, or do something that will have the same effect
Answer by jonas-echterhoff · Feb 16, 2011 at 09:12 AM
I'm not sure I fully understand your setup, but wouldn't it be simpler to do the parenting the other way around? Ie, to have the rotating object be the child of the collider/rigidbody, and not the other way around?
$$anonymous$$y setup is kind of hard to explain, but no that won't work for me. Basically the rotating object is the controller for my character, so it can't be a child of my character.
I figured out a workaround for what I am trying to do, so I don't need to know this, but I would like to know if it is possible and how for future reference.
Workaround worked (well that's the point) I am in good shape, but still curious.
Your answer
Follow this Question
Related Questions
Rotating a transform with child rigidbodies 0 Answers
Can i Move/Rotate triggers without Rigidbodies? And other collider questions. 3 Answers
Player Is able to rotate through walls. 2 Answers
Collisions While Rotating Objects Without Character Controllers 1 Answer
2d sprite falls through floor 0 Answers