Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | TheExtraNerdyFox |
Heres my code:
func _physics_process(_delta):
apply_gravity()
# L and R movement
var input = Vector2.ZERO
input.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
# Slide
if input.x == 0:
apply_friction()
top.animation = "Idle"
feet.animation = "Idle"
else:
apply_acceleration(input.x)
if input.x > 0:
top.animation = "Run"
feet.animation = "Run"
feet.flip_h = false
top.flip_h = false
AWAY_FROM_WALL = -250
wallCast.cast_to = 11
elif input.x < 0:
top.animation = "Run"
feet.animation = "Run"
feet.flip_h = true
top.flip_h = true
AWAY_FROM_WALL = 250
wallCast.cast_to = -11
Its the wallCast.cast_to = [int] that doesn’t work. Why?
ITS SO FRUSTRATING!!!
TheExtraNerdyFox | 2022-12-31 15:05