Box2D Forums

It is currently Mon May 20, 2013 4:53 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Moving on rails
PostPosted: Wed Feb 01, 2012 4:49 pm 
Offline

Joined: Fri Nov 18, 2011 5:11 am
Posts: 3
i want my player body to move to a certain point where i clicked and stop there.
to do this i want the body to move in a straight line, so the body has to be stopped for the force to move it in a straight line, but i can't figure out how to stop it from moving in an instant. changing linearVelocity to (0,0) and angularVelocity to 0 doesn't seem to stop it.


Top
 Profile  
 
 Post subject: Re: Moving on rails
PostPosted: Wed Feb 01, 2012 6:07 pm 
Offline

Joined: Sun Oct 25, 2009 3:28 am
Posts: 242
Arnas wrote:
i want my player body to move to a certain point where i clicked and stop there.
to do this i want the body to move in a straight line, so the body has to be stopped for the force to move it in a straight line, but i can't figure out how to stop it from moving in an instant. changing linearVelocity to (0,0) and angularVelocity to 0 doesn't seem to stop it.

Are you using the body's SetLinearVelocity() and SetAngularVelocity() functions to stop it? Altering the body definition that is stored in the body after it's already been made will not change the behavior of the body.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group