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 shooter games (war robots, fortnite, gun of booms...).
But it seems its not possible to 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
It is possible to fixe that ? (Idont want to use rotatecharacter, because its absolutely not the same thing)
We should move our character in two directions at the same time, its an essential feature for a lot of 3d games
Thank you very much.
I use the excellent character controller in a lot of my 3d games, for example in my 3d shooter game, so i really need to move my character in the two directions :
AGK2 tier1 - http://www.dracaena-studio.com