Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | DarlesLSF |
When I’m fade out my character with these sprites, he change his frame like walking up. Anyone knows why this happen?
Here’s the code:
func _on_Timer3_timeout():
letras = false
get_node("../choose_your_path").rect_position = Vector2(get_viewport_rect().size.x/2 - 90, get_viewport_rect().size.y/2 - 200)
get_node("../Player").position = Vector2(320, 240)
ligou_alpha = true
func _process(delta):
if ligou_alpha:
alpha += .02
get_node("../Player").modulate = Color(1,1,1, alpha)
get_node("../choose_your_path").modulate = Color(1,1,1, alpha)
get_node("../gAzul").modulate = Color(1,1,1, alpha)
get_node("../gVermelha").modulate = Color(1,1,1, alpha)
if alpha > 1:
get_node("../gAzul").subindo = true
get_node("../gVermelha").descendo = true
get_node("../Player/Normal").frame = 7
Global.pode_andar = true
alpha = 1
ligou_alpha = false
The “Global.pode_andar” let the character walk and the frame = 7 set the sprite to look down, but idk why change to the sprite to look up.