Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Apply force to move a physics object in exact direction. — Gideros Forum

Apply force to move a physics object in exact direction.

edited June 2013 in General questions
Hi all,

I want my physics object to move to target at exact direction. However, when I use applyForce() or applyLinearImpulse() it only moves nearly right my target direction.

I find that it move exactly when I set object density = 0.0, however if I do so there will be no rotation.
local strength = 0.5
local xVect = (targetX - objX)*strength
local yVect = (targetY - objY)*strength
obj.body:applyForce(xVect, yVect, targetX, targetY)
Please help !!!

Comments

Sign In or Register to comment.