#Weird bug (also related to Finite State Machine)

5 messages · Page 1 of 1 (latest)

summer fossil
#

Bugged line:
player.velocity.x = dir * player.roll_speed
(dir is just Input.get_axis("left","right"), and player.roll_speed is 190)

So I was making a rolling state for my player character, and the line seems to be perfectly fine, and even the velocity when printed out is 190 or -190 depending on dir, but the sprite just isn't moving, for no reason at all.
Anyone know what might be wrong???

ember river
#

The first thing it comes to mind with this type of error is that you may be missing move_and_slide() after modifying the speed, which printa the right speeds and animations but the body wont move. Just a guess though.

summer fossil
#

OHHHH I forgot to add move_and_slide in the rollstate script

#

ima try adding it

#

yep, it works