Missing things?
This commit is contained in:
parent
c495b93197
commit
929f5ec4d3
@ -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 )
|
||||
|
@ -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):
|
||||
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user