|
So I've been working on this incredibly complex control system only to discover "addRelativeForce" and facepalm. Say I have a rigidbody sitting on a moving object, and I want it to move at a goal speed in relation to the object it's on. (For example, character run at 10mph + the train's speed of 40mph.) From what I understand, using addForce for this will simply make my character attempt to reach a grand total of 10mph, whereas addRelativeForce will make my character attempt to reach 10mph + the train's speed. Is this about right?
(comments are locked)
|
|
No, not quite. AddForce adds force in world coordinates and AddRelativeForce adds force in local coordinates.
is the same as
If you have a rigidbody sitting atop a moving object, the amount of force transferred from the the moving object to the rigidbody is determined by the amount of friction on both of the objects' collider's physic material, the amount of force pushing the body against the moving object and the mass of the rigidbody. If you have no friction, you would have to add the force of the moving object while they are in contact. AddForce will always add force. If you are moving with the same forces as the train (however you decide to achieve this), when you AddForce on top of that, you will be moving with that much more force than the train. Force is not measured in units of velocity(distance/time), but in units of Force (Newtons or whatever). Applying a force doesn't necessarily apply enough force to reach velocity x except in a completely empty and appropriately setup system because of things like drag, surface interactions and constant forces and the like which will affect velocity in different ways. With drag, the rigidbody will slow to a stop as it moves. Physic materials and collisions can easily have a wide variety of effects on velocity from bouncing back with equivalent force to friction adding the velocity of whatever was collided with. @skovacs1: thanks for explaining that to them, because this is the first post i saw with the subject, and i wanted to know how to add force in local coords, and you helped me understand how... thanks!
Dec 22 '10 at 04:49 PM
Jesus_Freak
(comments are locked)
|
|
Not really. @Francis Fernandez, yes very true,thanks for clearing this out.
Jul 27 '12 at 11:27 AM
Fady-S
(comments are locked)
|
