Skip to content

Commit

Permalink
Fix 'create_snap' desync
Browse files Browse the repository at this point in the history
If the player drops then picks up a 'SnapZone' with a 'PickableObject' in it the 'PickableObject' will lag behind during player or SnapZone movement due to calling 'create_snap'. Adding the driver as a direct child of the grabber prevents any desync. 'create_lerp' function is similar but has been left out until further testing.

Tested on Godot 4.3.stable
  • Loading branch information
squidt committed Dec 27, 2024
1 parent f9701c5 commit f3d03fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions addons/godot-xr-tools/objects/grab_points/grab_driver.gd
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,8 @@ static func create_snap(
# Snapped to grab-point so report arrived
p_grab.set_arrived()

# Add the driver as a neighbor of the target as RemoteTransform3D nodes
# cannot be descendands of the targets they drive.
p_target.get_parent().add_child(driver)
# Add driver to child of grab node3d so p_target uses that transform
p_grab.by.add_child(driver)
driver.remote_path = driver.get_path_to(p_target)

# Return the driver
Expand Down

0 comments on commit f3d03fa

Please sign in to comment.