Howdy all.
I need to get the direction my character is facing (Vector?) when a user hits wsad keys. The Character moves fine, of course its a sphere for now so I cant tell which way its actually facing.
Heres some code...
I need to get the direction my character is facing (Vector?) when a user hits wsad keys. The Character moves fine, of course its a sphere for now so I cant tell which way its actually facing.
Heres some code...
;Function Init_Models
Ply.Plyr(0)\Modl = CreateSphere()
ScaleEntity Ply.Plyr(0)\Modl,.5,.5,.5
EntityColor Ply.Plyr(0)\Modl,255,0,0
Ply.Plyr(0)\Piv = CreatePivot()
EntityRadius Ply.Plyr(0)\Piv,.5,.5
EntityParent Ply.Plyr(0)\Modl, Ply.Plyr(0)\Piv
;Function Move
If KeyDown(17) Then ;W
MoveEntity Ply.Plyr(0)\Piv,0,0,Speed
EndIf
If KeyDown(31) Then ;S
MoveEntity Ply.Plyr(0)\Piv,0,0,-Speed
EndIf
If KeyDown(32) Then ;D
MoveEntity Ply.Plyr(0)\Piv,Speed,0,0
EndIf
If KeyDown(30) Then ;A
MoveEntity Ply.Plyr(0)\Piv,-Speed,0,0
EndIf