Box2D Forums

It is currently Sat May 18, 2013 8:46 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Nov 02, 2011 1:38 pm 
Offline

Joined: Fri Oct 07, 2011 9:39 am
Posts: 21
Hello, Im moving my body with:

Code:
body.setLinearVelocity(b.getLinearVelocity().x, -20);


and it works good. But all the time with the same speed, how can I increase it? Changing 2nd parameter doesn't change anything.

Thanks for help!


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 7:26 pm 
Offline

Joined: Tue Jun 28, 2011 6:56 am
Posts: 20
first of all i don't think you should use setLinearVelocity, but you shoul ude applyImpulse or applyForce, or you will get strange result.

as i can say, you are taking "b" 's X velocity and appling it to "body", and setting a fixed velocity of -20 on the Y axies.


Top
 Profile  
 
PostPosted: Thu Nov 03, 2011 12:10 pm 
Offline

Joined: Fri Oct 07, 2011 9:39 am
Posts: 21
I haven't been using setForce because I thought kinematic body doesn't react for forces - thanks I will try it.


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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