- Home /
Ignore force on impact
Hi,
I have a big rotating object that is hit by a smaller one. Is there a way to have the big object ignore the impact force from the hit only regarding the rotation? Right now it rotates faster upon impact depending on spot where the collision happened (e.g. upper edge from the right makes it rotate faster counter clockwise). I'd like to have the big object rotate as if nothing happened. Both objects have rigid bodies and I need the physics to work as expected because I want the small object to stay attached to the big one after the collision. I make the objects stick by applying a force on the small object towards the center of the big one.
thx.
Answer by aldonaletto · Jan 09, 2012 at 12:38 AM
You can try to use rigidbody.freezeRotation = true in the big object: this will disable rotational effects originated by physics - and rotate the object using transform.Rotate in FixedUpdate:
var rps: float = 0.3; // rotations per second
function Start(){ rigidbody.freezeRotation = true; }
function FixedUpdate(){ // rotate around the Y axis: transform.Rotate(0, rps * Time.deltaTime, 0); }
Hey thanks for the idea. I just realized that I already did this. The only difference was that the rotation freeze was set via the inspector as a constraint of the rigidbody component. This seems to work but I have another problem that it pushes the object away - but that's another problem (I will try setting the mass to extreme values).
So in other words you don't want any physics on the big object. Just tick is$$anonymous$$inematic in the inspector. This will prevent any external forces to affect the rigidbody. kinematic rigidbodies can affect other non-$$anonymous$$ematic rigidbodies.
No that's not it. I still need the big object to behave correctly - that's why it has a rigidbody.
Your answer
Follow this Question
Related Questions
Full impact force vs sliding impact force 1 Answer
Artificial Gravity 2 Answers
Firing projectile in curve 1 Answer