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

PathFollow broken when changing Offset using C# #52168

Closed
tobiasleissner opened this issue Aug 27, 2021 · 4 comments
Closed

PathFollow broken when changing Offset using C# #52168

tobiasleissner opened this issue Aug 27, 2021 · 4 comments

Comments

@tobiasleissner
Copy link

Godot version

3.4 beta 4 mono

System information

macOS Big Sur 11.5.2, Apple M1

Issue description

Changing the Offset of a PathFollow node should lead to moving children nodes. This works when using GDScript, but the children stay at the same global world location when using C#.

This works in Godot 3.3.3, but doesn't work in Godot 3.4 beta 4, so it's a Godot 3.4 specific issue.

Steps to reproduce

  1. Create a Path
  2. Create a PathFollow node as child
  3. Create a KinematicBody (3D) as a child of PathFollow, add a simple box mesh
  4. Add a script to PathFollow in _PhysicsProcess
  5. Change the offset according the delta time (change over time, specific algorithm doesn't matter)
  6. Start game

In GDScript, everything works fine. Global transform of children of PathFollow nodes change accordingly.
In C#, the child nodes of PathFollow do not move. Using the Remote view of the debugger shows what happens:
PathFollow moves to the left, while the child nodes move the same amount to the right.

This works in Godot 3.3.3, so this seems to be a 3.4 beta 4 specific issue.

Minimal reproduction project

Sample GDScript for PathFollow

func _physics_process(delta):
	t += delta
	var new_offset = t * speed
	
	if new_offset > length:
		t = 0

	self.offset = new_offset
@akien-mga
Copy link
Member

Related to #50986 / #51357, CC @raulsntos.

@raulsntos
Copy link
Member

raulsntos commented Sep 14, 2021

@akien-mga Those PRs change the C++ code so it would modify the behavior for both GDScript and C#, also C# doesn't have a custom implementation of PathFollow it just makes native calls to the C++ code so it should behave the same way GDScript does.


@tobiasleissner I could not reproduce this issue in v3.4.beta4.mono.official [6a058cb] with this minimal project created following your instructions:
path_test.zip

All I can think of is maybe the code you are using in C# is different to the GDScript version? Could you provide a minimal reproduction project with the C# code so I can take a look?

@akien-mga
Copy link
Member

Ah I missed that this mentioned a C# specific issue, @Chaosus' label was correct then :)

@tobiasleissner
Copy link
Author

I had a project with this exact behavior. However, after I deleted the nodes and recreated them, added the scripts, it worked. I cannot get back to the previous version.
I cannot reproduce it anymore.

This issue can be closed then. If it happens again within my project, I will attach the project file and reopen the issue.
Thanks for taking a look at it anyways.

@Calinou Calinou removed this from the 3.4 milestone Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants