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.

Newcomers AppGameKit Corner / Directional control of objects

Author
Message
Nickkall
7
Years of Service
User Offline
Joined: 19th Jul 2017
Location: Sydney, Australia
Posted: 27th Jul 2017 10:38
Hi All,

I am trying to work out directional controls for objects in a 3d world. I have just moved over from GameMaker Studio 1.4 and they have directions from 0 to 360.

Here is what I am using to control a ship. Right click on screen and turn towards that point...



When trying to work directional control in AGk, it seems that direction is 0 to 180 to -180 to 0.

Is this correct?

Thank you for your replies.

Nick
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th Jul 2017 19:14
Hi Nick,

Per the Atan2 command help page you are correct. In the physics/ragdoll demo created by stabinthedarksoftware there is a nice wrapangle function. I use that.

https://www.appgamekit.com/documentation/Reference/Core/ATan2.htm


You may also want to check out his character controller. I believe a lot of people here utilize that.
Nickkall
7
Years of Service
User Offline
Joined: 19th Jul 2017
Location: Sydney, Australia
Posted: 28th Jul 2017 12:21
Thank you Goleron,

I will check it out.

Login to post a reply

Server time is: 2024-11-22 15:32:02
Your offset time is: 2024-11-22 15:32:02