deleted colliders now freed properly

This commit is contained in:
Leon Palluch 2020-02-02 13:18:18 +01:00
parent 9defb29c04
commit bf76603c08
7 changed files with 1145 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Flugeltextur.png-26cef747ba4cfd8b0ac92c412a917c69.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://3D Input/Flugeltextur.png"
dest_files=[ "res://.import/Flugeltextur.png-26cef747ba4cfd8b0ac92c412a917c69.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://3D Input/stiertextur.png"
dest_files=[ "res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -51,7 +51,6 @@ func _ready():
func change_count_ui():
if done_player_count == null:
print("test")
done_player_count = 0
_playerNum.text = str(done_player_count + 1) + "/" + str(InGameState.player_count)
@ -169,6 +168,9 @@ func delete_body_part():
var body_part = _attachment_point.get_node("Limb").get_child(0)
if body_part != null:
_costProgress.value -= body_part.cost
#delete collider with id
var old_col_path = "LimbCollider" + str(_attachment_point.id)
_torso.get_node(old_col_path).queue_free()
body_part.queue_free()

View File

@ -2,6 +2,7 @@ extends Spatial
export(int) var key
export(int) var id
onready var limb = get_node("Limb")

View File

@ -25,6 +25,7 @@ shape = SubResource( 1 )
[node name="DownFrontLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.965926, -1.45851e-07, -0.258819, -1.50996e-07, -1, -1.77636e-15, -0.258819, 3.90806e-08, -0.965926, 1.3, 1, 4.2 )
key = 68
id = 1
[node name="Mesh" parent="DownFrontLeft" index="0"]
transform = Transform( 0.2, 0, 3.72529e-09, 0, 0.2, 0, -3.72529e-09, 0, 0.2, 0, 0, 0 )
@ -32,6 +33,7 @@ transform = Transform( 0.2, 0, 3.72529e-09, 0, 0.2, 0, -3.72529e-09, 0, 0.2, 0,
[node name="DownFrontRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.965926, -1.45851e-07, 0.258819, -1.50996e-07, -1, 1.77636e-15, 0.258819, -3.90806e-08, -0.965926, -1.3, 1, 4.2 )
key = 70
id = 2
[node name="OmniLight" parent="DownFrontRight" index="1"]
transform = Transform( 1, 3.13083e-13, 0, -3.09641e-13, 1, -5.59552e-14, 0, 5.59552e-14, 1, -0.680858, -1.19209e-07, -1.38872 )
@ -42,26 +44,32 @@ transform = Transform( 0.5, 1.4988e-15, 0, 1.4988e-15, 0.5, 0, 0, 0, 0.5, 0, 0,
[node name="DownBackRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.982402, -3.24601e-07, 0.0859489, -3.2133e-07, -1, 0, 0.0859489, -2.83989e-08, -0.982402, -1.9, -1, 3.6 )
key = 83
id = 3
[node name="DownBackLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.982402, 3.24601e-07, -0.0859489, 3.2133e-07, -1, 0, -0.0859489, -2.83989e-08, -0.982402, 1.9, -1, 3.6 )
key = 65
id = 4
[node name="UpFrontLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.103081, -3.40598e-08, -0.980752, -3.2133e-07, -1, 0, -0.980752, 3.24056e-07, -0.103081, 2.9, 0, -2 )
key = 69
id = 5
[node name="UpFrontRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.103081, 3.40598e-08, 0.980752, 3.2133e-07, -1, 0, 0.980752, 3.24056e-07, -0.103081, -2.9, 0, -2 )
key = 82
id = 6
[node name="UpBackRight" parent="." instance=ExtResource( 2 )]
transform = Transform( -0.870723, 0.384569, 0.26555, -1.84307e-07, -0.573576, 0.807811, 0.462972, 0.723268, 0.499426, -1, -1.9, -2.5 )
key = 81
id = 7
[node name="UpBackLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( -0.870723, -0.384569, -0.26555, 1.84307e-07, -0.573576, 0.807811, -0.462972, 0.723268, 0.499426, 1, -1.9, -2.5 )
key = 87
id = 8
[node name="Torso" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.5, 0, 0, 0, -2.18557e-08, 0.5, 0, -0.5, -2.18557e-08, 0, 0, 0 )

View File

@ -23,7 +23,10 @@ func _process(delta: float) -> void:
var translation = physics_shape.global_transform
print(translation)
var attach_id = get_parent().get_parent().id
remove_child(physics_shape)
physics_shape.name = "LimbCollider" + str(attach_id)
base.add_child(physics_shape)
physics_shape.global_transform = translation