Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Noob_Maker |
Hello!
I am working with the AnimationPlayer
and I understand how it works. The issue I’m having is that when I write in my GDscript
for the AnimationPlayer
to change different animations based on user input and there are no issues that I can see with the code but for some weird reason only one of the test animations that I’m testing this plays while the rest not when I clearly stated all three of the test animations.
extends AnimationPlayer
#the long list of controls XD
var UpRelease = Input.is_action_just_released("ui_up")
var Up = Input.is_action_pressed('ui_up')
var DownRelease = Input.is_action_just_released('ui_down')
var Down = Input.is_action_pressed('ui_down')
var RightRelease = Input.is_action_just_released('ui_right')
var Right = Input.is_action_pressed('ui_right')
var LeftRelease = Input.is_action_just_released('ui_left')
var Left = Input.is_action_pressed('ui_left')
func _ready():
#getting the animation data
get_animation("standingRight")
get_animation("standingLeft")
get_animation("standingFoward")
set_process(true)
func _process(delta):
UpRelease = Input.is_action_just_released("ui_up")
Up = Input.is_action_pressed('ui_up')
DownRelease = Input.is_action_just_released('ui_down')
Down = Input.is_action_pressed('ui_down')
RightRelease = Input.is_action_just_released('ui_right')
Right = Input.is_action_pressed('ui_right')
LeftRelease = Input.is_action_just_released('ui_left')
Left = Input.is_action_pressed('ui_left')
# this is where I put the playing commands
if DownRelease == true:
play('standingFoward')
if RightRelease == true:
play('standingRight')
if LeftRelease == true:
play("standingLeft")
Doesn’t answer your question, but I don’t think the get_animation() calls are doing anything since you aren’t assigning them to variables or anything.
Socrates | 2018-05-11 02:40