0 votes

I have an entity that needs to follow a path, and so I have my level tree as follow:

> Node2D
  > YSort
    > Player
    > OtherNode
    > AnotherNode
    > Path2D
      > PathFollow2D
        > Sprite

where the PathFollow2D is the root node of another scene that holds all the nodes for a certain entity, and has been instanced as a child of Path2D. However, this doesn't seem to play well with the YSort. What I would like is for it to act as if it was just another node/entity nested under YSort, but just have it follow a certain path.

in Engine by (1,605 points)
edited by

1 Answer

+2 votes
Best answer

The solution to this was to use the RemoteTransform2D node.

The scene tree ended up as follows:

> Node2D
  > YSort
    > Player
    > OtherNode
    > AnotherNode
    > Sprite
  > Path2D
    > PathFollow2D
      > RemoteTransform2D

Where the remote_path property of the RemoteTransform2D is set to the Sprite node.

by (1,605 points)
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.