From 214a10d79472c44f0eb5ea473a9d57ae5eedd664 Mon Sep 17 00:00:00 2001 From: karl Date: Sat, 1 Feb 2020 11:16:15 +0100 Subject: [PATCH] Fix collider issues with body parts --- Ingame/BodyParts/BodyPart.gd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Ingame/BodyParts/BodyPart.gd b/Ingame/BodyParts/BodyPart.gd index 6b634d7..316e6de 100644 --- a/Ingame/BodyParts/BodyPart.gd +++ b/Ingame/BodyParts/BodyPart.gd @@ -20,14 +20,15 @@ func _ready() -> void: func _process(delta: float) -> void: + # We do this here because we want the whole tree to really be done instancing if not setup_done: - var translation = physics_shape.to_global(physics_shape.translation) - physics_shape.translation = Vector3.ZERO + var translation = physics_shape.global_transform.basis * physics_shape.translation remove_child(physics_shape) base.add_child(physics_shape) - physics_shape.global_transform.origin = translation + physics_shape.translation = translation + setup_done = true