0 votes

I've created an object as a scene (sprite node). This one has an animation that only makes it change position on the y axis.
The problem is that when instantiating the object in my main scene the animation is done from the point (0,0) ... place where I made the animation in the object scene .... but I want the animation to be done just at the point where the object was created .... how could it do
Data ... Use the transform property of the object to animate it

in Projects by (88 points)

1 Answer

+1 vote

The way it is: Do not animate the parent node, animate one of its children so the child moves in relation to the parent. Make sure the child node is at position 0,0 relative to its parent. Then perform the animation on this node.
Example for your instantiate scene:

Node2D //Parent
----Sprite //Animate position here
----AnimationPlayer

by (1,203 points)

I was using an Area2D as the parent node and it worked perfectly for it as well.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories