Skip to content

Commit

Permalink
Find target using get_parent to support reparenting at runtime.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nanodeath committed Jul 31, 2024
1 parent 0c4ae88 commit bd89ec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/smoothing/smoothing.gd
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func _FindTarget():
# If no target has been assigned in the property,
# default to using the parent as the target.
if target.is_empty():
var parent = get_parent_node_3d()
if parent:
var parent = get_parent()
if parent and parent is Node3D:
_m_Target = parent
return

Expand Down

0 comments on commit bd89ec7

Please sign in to comment.