title ^^^^^^^^^^^^^^^^^^^^^^^^
You have several options.
-
To create a Tween
-
Another option is to just… do it by code? you don’t need to animate a position, maybe it’s more clear if you just move NodeA towards NodeB.
-
If you’re forced to do it with animations (AnimationPlayer), you can create an animation, from position A to position B and then modify in your script the value of the keyframe for B.
Tell me which one you prefer and if you need I can provide more details on how to do it.
so basicly just keep using code like i have been sounds good!
In general, you want to have the control of the position of your Player/Enemies/objects. If you give that control to animators and you’re not 100% sure of what you’re doing, you might later encounter problems that will give you a big headache before solving them. Also positions are important for the physics engine (if your game uses collisions or velocity).
Yes, in general it’s better to handle the positions with code.
nah it works good just a tad bit harder because you got like 30+ lines per animation for example
"Ember":
res.texture = load("res://assets/moves/ember.png")
res.hframes = 5
res.frame = 0
res.scale = Vector2(2,2)
res.position = target
res.show()
await get_tree().create_timer(.1).timeout
res.frame = 1
await get_tree().create_timer(.1).timeout
res.frame = 2
await get_tree().create_timer(.1).timeout
res.frame = 3
await get_tree().create_timer(.1).timeout
res.frame = 4
await get_tree().create_timer(.1).timeout
res.hide()
res.frame = 0
res.hframes = 1
res.scale = Vector2(1,1)