Hi
I use a 3D character physics, and Move3DPhysicsCharacterController() to move it (forward, backward, left, right) and mouse to rotate it, like in a lot of 3D game.
But How can I move the character in 2 directions at the same time ( ex: left & forward).
What I have tried, but it doesn't work
, only 1 direction works.
if GetVirtualJoystickX(1) <> 0 or GetRawKeyState(37) or GetRawKeyState(39)
if GetVirtualJoystickX(1)>0 or GetRawKeyState( 39 )
DirX = 4
dir# = GetVirtualJoystickX(1)
if dir# =0
dir# = 1
endif
elseif GetVirtualJoystickX(1)<0 or GetRawKeyState( 37 )
dirx = 3
dir# = -GetVirtualJoystickX(1)
if dir# =0
dir# = 1
endif
endif
Move3DPhysicsCharacterController(objID, dirX, dir#*WalkVelocity)
endif
//up key Forwards
if GetVirtualJoystickY(1) <> 0 or GetRawKeyState( 38 ) or GetRawKeyState( 40 )
if GetVirtualJoystickY(1) < 0 or GetRawKeyState( 38 )
dirY = 1
dir# = -GetVirtualJoystickY(1)
if dir# =0
dir# = 1
endif
elseif GetVirtualJoystickY(1) > 0 or GetRawKeyState(40)
dirY = 2
dir# = GetVirtualJoystickY(1)
if dir# =0
dir# = 1
endif
endif
Move3DPhysicsCharacterController( objID, dirY, dir#*WalkVelocity )
endif
Do you know how I can move my character in 2 directions at the same time (without rotate it of course) ?
Thank you.
AGK2 tier1 - http://www.dracaena-studio.com