Missing things?

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

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 )

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):

View File

@ -18,10 +18,16 @@ _global_script_classes=[ {
"class": "BodyPart",
"language": "GDScript",
"path": "res://Ingame/BodyParts/BodyPart.gd"
}, {
"base": "BodyPart",
"class": "PushingBodyPart",
"language": "GDScript",
"path": "res://Ingame/BodyParts/PushingBodyPart.gd"
} ]
_global_script_class_icons={
"BodyBase": "",
"BodyPart": ""
"BodyPart": "",
"PushingBodyPart": ""
}
[application]