• 2D
  • How to make animation position change start from current character position

I added Position key changes, and I'm moving my object from its 0,0 position to a couple hundred pixels to the right. Instead of the animation starting from where the object is, the object starts at screen 0,0.

How do I make it start from where it happens to be at any given moment?

Welcome to the forums @"Ryan Scott"!

Instead of modifying the position in the animation, instead modify the translation property. It sounds like you modified the global position, which is why it is relative to the origin of the world. The translation property is the position of the node relative to it's parent. If you use the translation in the animation, you can just move the parent node of whatever is being animated to the position you want the animation to start, and then play the animation. Then it will move a couple hundred pixels relative relative to the parent node, which should give the desired effect.

Hmm. Translation is not an option when I want to add a new track.

It's a kinematic2d if that helps.

@"Ryan Scott" said: Hmm. Translation is not an option when I want to add a new track.

It's a kinematic2d if that helps.

Right, translation is for Spatial nodes, not 2D. The equivalent for 2D is position. However, that is what you were using, so I’m guessing that is not the issue.

What are you trying to do?

If you are trying to move the player with physics (hence the KinematicBody2D node), you will need to use the move_and_slide or move_and_collide functions with a velocity instead. The documentation has a page on how to make simple 2d character movement that might be helpful. Animating the position of the player through an AnimationPlayer will not let the KinematicBody2D react to physics, unfortunately.