Godot Version
Replace this line with your Godot version
Question
Hi, i got same trouble i met some time ago: I was sure to have fixed it but it doesnt look so…in the scene tree i have:
An AnimatableBody2D mode whose child is an AnimationPlayer node; within it i defined an animation by tracking ‘position’ feature setting 2 points along the animation track:
The problem is the mismatch between animation played within the editor and when I run the game…
This is very little information. Can you show us some screenshots and code? Maybe a video? Explain what you want to happen vs what actually happens?
Also please include your godot version.
This is a shot in the dark because as tibaverus said theres really not enough info to go on. Try adding a node2d as a parent of your platform. Im guessing when you go to move the AnimatableBody2D the animation player keeps moving it to the location it has it set as. If you move the Node2D (the parent of the AnimatableBody2D) then it may work. Again just a shot in the dark without really knowing anything about your project.
I forgot to report the godot version:
Godot 4.5.dev1
Following is a screeshot of the tree:
Can you explain your problem in more detail. We don’t understand whats going on when you say “mismatch between animation played within the editor and when you run the game”. I still believe what i said earlier to be true. How you have it set up right now if you try to move any of those platforms the animation player will move them back to where the animation player has them. I would try adding a node2d as a parent of each platform. Then move the node2d to wherever you want the platform.
If the animation player has an animation moving the “platform2” from vector2(0,0) to vectors2(0,100) and you try moving the “platform2” to vector2(300,400) when the animation player starts it will move the platform to vector2(0,0).
If you make the node2d a parent of “platform2” and move the node2d to vector2(300,400) then the “platform2d” will move vector2(0,0) to vector2(0,100) based on its parents location which is the node2d.
I could still be way off because I am unsure of what the actual issue is.
Ok, honestly I cannot fulfill what the solution was, but in the end It works how expected:However:
platforms root is a Node2D and platform3 is an AnimatbleBody2D node