Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / couple questions (turning)

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 16th Jun 2007 19:46
hi im using a dynamic box for my players movement.

1 how can i make the box not turn at all when i let go of the left/right arrow key??


2 how can i make the box not move at all if i let go of the upkey????

??
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 17th Jun 2007 01:22
i'm not sure what you mean, but surely you would just be using something like


in your loop.


[Looking for work]
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 17th Jun 2007 07:15 Edited at: 17th Jun 2007 07:16
If I understood correctly, you want your object to halt immediately once no key is pressed, instead of slowly stopping due to friction.

If this is so, for the movement to stop you just set the linear velocity to zero using phy set rigid body linear velocity, likewise for stopping rotation set zero the angular velocity with phy set rigid body angular velocity,

Example (continuing on the previous code from here):



Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.

Login to post a reply

Server time is: 2024-11-24 19:36:07
Your offset time is: 2024-11-24 19:36:07