Missing things?

This commit is contained in:
karl committed 2020-02-01 11:09:06 +01:00
1 parent c495b93197
commit 929f5ec4d3
3 files changed
+23 -4

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ func push(body):
[sub_resource type="SphereShape" id=4]
[sub_resource type="SphereShape" id=3]
radius = 0.803016
radius = 0.591769
[node name="Arm" instance=ExtResource( 1 )]
script = SubResource( 1 )
+15 -2
View File
@@ -9,13 +9,26 @@ onready var physics_shape = get_node("PartCollider")
export(int) var key
var setup_done = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
assert(base is BodyBase)
remove_child(physics_shape)
base.call_deferred("add_child", physics_shape)
func _process(delta: float) -> void:
if not setup_done:
var translation = physics_shape.to_global(physics_shape.translation)
physics_shape.translation = Vector3.ZERO
remove_child(physics_shape)
base.add_child(physics_shape)
physics_shape.global_transform.origin = translation
setup_done = true
func _unhandled_input(event):