Hi everyone.
I have an app where the user clicks and holds the mouse to build up force, when released, it will apply force to objects in the world based on how long the mouse was held down.
In the docs for applyForce it says the second parameter is "the world position of the point of application." So to me that says it's the global position of the mouse x and y when clicked in this case.
But this doesn't work. It does apply force to my objects, but it adds no torque at all. If I change the point to be 0, 0 instead of where the mouse is clicked, then it appears to work fine. It will add torque along with linear force. Why is this? Can someone explain this parameter in more detail and what it actually means? Because it seems to me that all I have to do is always apply the force at 0, 0... but then what's the point of having it if that's the only way ti works? Is it local to the body the force is applied to? Is it global tot he world like it says? And if it's global then why does using the mouse coordinates not work properly?
Thanks so much!
Kyle
I have an app where the user clicks and holds the mouse to build up force, when released, it will apply force to objects in the world based on how long the mouse was held down.
In the docs for applyForce it says the second parameter is "the world position of the point of application." So to me that says it's the global position of the mouse x and y when clicked in this case.
But this doesn't work. It does apply force to my objects, but it adds no torque at all. If I change the point to be 0, 0 instead of where the mouse is clicked, then it appears to work fine. It will add torque along with linear force. Why is this? Can someone explain this parameter in more detail and what it actually means? Because it seems to me that all I have to do is always apply the force at 0, 0... but then what's the point of having it if that's the only way ti works? Is it local to the body the force is applied to? Is it global tot he world like it says? And if it's global then why does using the mouse coordinates not work properly?
Thanks so much!
Kyle