Adam's Lair Forum

game development and casual madness
It is currently 2019/09/17, 15:15

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 2013/12/08, 13:57 
One-Hit Wonder
One-Hit Wonder
User avatar

Joined: 2013/12/08, 12:54
Posts: 1
Location: l'aquila, italy
Role: Hobbyist
Hi, i'm starting a platform project using Duality, and i'm stuck because of this problem.

When i set the
Player.GameObj.RigidBody.LinearVelocity = (-Vector2.UnitX * 3f);
it will result in a kinda weird behaviour, because setting the orizontal velocity to a flat value will reset the vertical speed, interrupting the fall or jump of the body (or even preventing them in some cases).

I've tried to look around the core/plugins but i'm a little lost, cause i didn't clearly understand how to set an horizontal speed without altering the vertical one.

_________________
-|-


Top
 Profile  
 
PostPosted: 2013/12/08, 14:27 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
Code:
RigidBody body = Player.GameObj.RigidBody;
body.LinearVelocity = new Vector2(-3.0f, body.LinearVelocity.Y);


;)

_________________
Blog | GitHub | Twitter (@Adams_Lair)


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

All times are UTC + 1 hour [ 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

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group