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.

DarkBASIC Professional Discussion / move object to X Direction

Author
Message
Behdadsoft
16
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 2nd Mar 2015 14:36
Hi.

I wrote a code for move object to right but when I Press Right key, my object don't move to right and move to another direction. I want my object move to x direction.

this is my code:



Please guide Me.

Thanks.
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 2nd Mar 2015 15:30 Edited at: 2nd Mar 2015 15:32
Hello Behdadsoft The Move commands move the object down their local axes rather than a global one. If you can imagine a line pointing out the side of the object that represents the x axis, now if you move left or right you'd be moving down this line. Now imagine that objecting rotating, that line would also rotate and this is what's causing the objects to not move correctly.

What you need to do is change it's x position, for instance:
Position Object 1, Object Position X(1)+0.0001, Object Position Y(1) ,Object Position Z(1)

"Get in the Van!" - Van B
Behdadsoft
16
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 2nd Mar 2015 20:58
Thanks Sasuke

Login to post a reply

Server time is: 2025-05-13 14:17:01
Your offset time is: 2025-05-13 14:17:01