Why change my Character the osition if the animation starts?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By reeve
:warning: Old Version Published before Godot 3 was released.

The Situation is that I have create a Scene with a Node2d as a root node.
This root node has a Tilemap as child. This Tilemap has 4 children. Two of them are Nodes from the type KinematicBody2D. These are saved at a tscn. The other two Nodes are from the type Area2D.
The imported Scene with the KinematicBody2D objects have a Sprite, a Collision shape and a animation player.

This is my World to test things.

Now the Problem. One of the Kinematic Nodes starts a animation if I push space. At this moment the cube jumps from his point in the World to the position of the root node.
What could the reason that the KinematicBody2D jumps to the root node if I start the animation.

Did you animated / set the global position of the node?
Also, which “cube” are you talking about? Having a minimal example scene to see would help.

Zylann | 2016-08-14 16:26

I have uploaded a video to show the Problem.
enter link description here
At the Player Scene I change the rotation of the KinematicBody2D.

reeve | 2016-08-16 12:40

:bust_in_silhouette: Reply From: Zylann

The animation you are playing has a track for transform/pos, which will always set the position of the node to a given value (which doesn’t actually changes given the look of the curve). If you just want your node to rotate, animate transform/rot only and remove pos and scale tracks.

Edit: I checked in the editor, I’m pretty sure your animation is setting that position. I’m not sure that’s what you want :slight_smile:

:bust_in_silhouette: Reply From: reeve

The reason for the activating of the position and the scale was that I have used them for my first experiments with the animation. I have changed this because of the problem that you have seen.
But your answer was really helpful. The problem was the activation of the position from the KinematicBody2D at the AnimationPlayer. At the Moment I have deleted the track transform/pos it works perfect.