How to strafe when i'm moving together with an object?
This is the code I'm currently using
If Upkey()=1 then Move object 10,10
if leftkey()=1
X#=newxvalue(X#,wrapvalue(A#-90),strafe_speed#)
Z#=newzvalue(Z#,wrapvalue(A#-90),strafe_speed#)
endif
if rightkey()=1
X#=newxvalue(X#,wrapvalue(A#+90),strafe_speed#)
Z#=newzvalue(Z#,wrapvalue(A#+90),strafe_speed#)
endif
If Downkey()=1 then Move object 10,-10
But it doesn't seem to be working. Do i need to store a coordinate of something first? I already wrote X#=5000 and Z#=500. Or if anyone know how to make collision detection if i'm using camera only?
PS
I'm sorry if this is a second post, because i've post it before but nothing seems to show up, and i needed a fast reply.