#player movement

9 messages · Page 1 of 1 (latest)

summer crescent
#

wait: so when you press a button and release it, it keeps moving in that direction?

stuck mica
#

yes i want that to happend but i have zero idea on how to make it

summer crescent
#

I'm not sure how to do that but I know it might use raycasts

#

but

#

thats all I know on that topic

stuck mica
#

ok

velvet rapids
#

super easy. When button pressed, set velocity in given direction. make sure theres no friction happening.

#

something like this:


var input = Input.getAxis
if input.magnitude > 0
  #it means the player wants to change direction
  velocity = input * speed```

This code isnt legit but its the correct idea. I just noticed youre in 3D. The idea should still be transferrable
#

Make sure gravity is turned off as well