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...
//Navigation Tools
if getrawmouserightpressed() //get the new navigation coordinates
playnavx = getrawmousex()
playnavy = getrawmousey()*(-1)
playnavz = 0
endif
setobjectposition(10,playnavx,playnavy,playnavz)
playnav = (ATan2((playnavx-playx),playnavy+playy)) // Calculate direction to Navigation Bug
if playdir < playnav
playdir = playdir + 5
endif
if playdir > playnav
playdir = playdir - 5
endif
playx = playx + cos(playdir)*playspeed
playy = playy - sin(playdir)*playspeed
setobjectposition(3,playx,playy,playz) //Moving the player object
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