Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PathFollow2D does not update child AnimatableBody2D's collision #63140

Open
illBeRoy opened this issue Jul 18, 2022 · 3 comments
Open

PathFollow2D does not update child AnimatableBody2D's collision #63140

illBeRoy opened this issue Jul 18, 2022 · 3 comments

Comments

@illBeRoy
Copy link

illBeRoy commented Jul 18, 2022

Godot version

4.0.alpha11

System information

M1 MBP, MacOS Monterey

Issue description

When nesting an AnimatableBody2D under a PathFollow2D, and changing the offset of the PathFollow node, the AnimatableBody node moves along the path, but the collision for that node stays at the origin.

For instance, take this scene:
image

And let's run it with paths and collision shapes visible:
image

As you can see, the animatable body and its child collision shape move along, but the collision detection still uses the origin point as where the platform really is.

Workaround

After updating the PathFollow2D offset, set the position of the AnimatableBody2D to itself:
image

Now the engine recognizes the new location of the collision shape, and updates accordingly:
image

Steps to reproduce

First, create a tree similar that contains a Path2D, PathFollow2D and a fully configured AnimatableBody2D:
image

Move the PathFollow2D node along the path using offset:
image

The collision of the AnimatableBody2D node did not update according to its new location.

Step to workaround

Right after you update the offset, assign the body's own global_position to iself. Now the collision is updated:
image

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Jul 18, 2022

@illBeRoy Please upload a minimal reproduction project to make this easier to troubleshoot.

@AttackButton
Copy link
Contributor

By the description, this is related with: #58269

@hawkerm
Copy link

hawkerm commented Oct 2, 2023

Agree, seems like a duplicate of #58269, that issue mentions a workaround which does seem to work at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

5 participants