Hi!
I'm trying to make basic FPS game and I have got my CharacterController and camera working properly but I have one question.
How can I make my character move diagonally which is possible basically in any 3D game?
Currently I'm using following script:
//W key Backwards
if GetRawKeyState( 87)
Move3DPhysicsCharacterController( objID, 2, WalkVelocity )
endif
//S key Backwards
if GetRawKeyState( 83 )
Move3DPhysicsCharacterController( objID, 2, WalkVelocity )
endif
//A Key Strafe Left
if GetRawKeyState( 65 )
Move3DPhysicsCharacterController( objID, 3, WalkVelocity - 65.0 )
endif
//D Key Strafe Right
if GetRawKeyState( 68 )
Move3DPhysicsCharacterController( objID, 4, WalkVelocity - 65.0 )
endif
but trying to do this (diagonal movement), it doesn't work:
if GetRawKeyState( 87 ) = 1 and GetRawKeyState( 65 ) = 0
Move3DPhysicsCharacterController( objID, 1, WalkVelocity )
else
if GetRawKeyState( 87 ) = 1 and GetRawKeyState( 65 ) = 1
Move3DPhysicsCharacterController( objID, 1, WalkVelocity )
Move3DPhysicsCharacterController( objID, 3, WalkVelocity )
endif
endif
-AreCustomize
"Anyone who has never made a mistake has never tried anything new."
-Albert Einstein