-
Notifications
You must be signed in to change notification settings - Fork 28
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
Reparenting frozen RigidBody3D breaks smoothing #58
Comments
Sorry I took a while, I've been afk for a few days. It looks like the problem is that on reparenting, you need to reset what the smoothing node is following. For convenience it automatically selects the parent node on The solution is to reset this nodepath by assigning the target again after reparenting: You may need to use a different script for the two different blocks in this example for it to work (as the control block doesn't have a smoothing node). This could possibly be handled better by the addon, but not a great reason to change as core physics interpolation should be available soon even in 4.x (after 4.3). |
Is the problem the target |
Yes, it does a few things like this for safety, should the node be deleted, if I remember right (I wrote it years ago). |
The more I dive into this, the more interesting it gets 🙂 I think I see the problem. The good news is smoothing-addon/addons/smoothing/smoothing.gd Line 144 in 0c4ae88
During
And we know
(emphasis mine) Basically, I think the solution is simply using |
Previously thsi was using get_parent_node_3d(), which returns null if top_level=true, which it is. Thus this check is guaranteed to fail except right when the Smoothing node is first initializing. Closes lawnjelly#58.
Previously this was using get_parent_node_3d(), which returns null if top_level=true, which it is. Thus this check is guaranteed to fail except right when the Smoothing node is first initializing. Closes lawnjelly#58.
Hi there. I have a CharacterBody3D character in my game that when they pick up a RigidBody3D, it static-freezes that object and reparents the object to the character, as well as adding the necessary collision-exclusion stuff. This mostly works, except for smoothing. The physics object itself will attach and move with the character as desired, which can be checked using Debug > Visible Collision Shapes, but the mesh stops moving with its parent object entirely.
Screencast.from.07-27-2024.08.15.02.AM.webm
In the above video, the left object is a normal cube, while the right object is using Smoothing. The expected behavior is that the mesh on the right will track the right collider, and generally look similar to the cube on the left. Both cubes reparent to the player after a 1 second delay.
SmoothingDesync.zip
And here's the repro project. Godot 4.2.2 + Smoothing 1.2.1. I've also verified it affects Godot 4.3-rc1 mono.
I don't have a workaround yet, but I was thinking of reparenting the mesh node depending on whether the item is being held. But also I don't really want to do that 😛
Thanks for looking!
The text was updated successfully, but these errors were encountered: