- Home /
Question by
anilgautam · Dec 13, 2012 at 09:30 AM ·
camerarigidbodyaddforceforce
Add force on camera using AddForce
Hello Guys
I am trying to add force to my camera transform.
I have added rigidbody to camera and checked is Kinematic .
selectedCamera.rigidbody.AddForce(transform.forward * 10, ForceMode.Impulse);
Camera does not move with the given code
please help
Comment
Best Answer
Answer by anilgautam · Dec 13, 2012 at 10:56 AM
It works when I removed check box is Kinematic
In deed. if you checked that...
"If $$anonymous$$inematic is enabled, Forces, collisions or joints will not affect the rigidbody anymore."
So your forces will not be applied...
$$anonymous$$
Answer by toum · Dec 13, 2012 at 09:47 AM
Try to see if your rigidbody sleep:
if (rigidbody.IsSleeping())
print("Sleeping");
If yes. Try to wake up?
rigidbody.WakeUp();
Then add force...