feat: adjusted player body node order & physics

This commit is contained in:
Sara Gerretsen 2025-12-01 18:35:43 +01:00
parent 6caf6263db
commit a5288e96e2
2 changed files with 52 additions and 47 deletions

View file

@ -3,9 +3,17 @@
[ext_resource type="PackedScene" uid="uid://cj3x6a8gm4ogn" path="res://assets/models/character.blend" id="1_yaurm"]
[ext_resource type="PackedScene" uid="uid://2fxwkeifrwu3" path="res://objects/effects/impact_decal.tscn" id="2_1p07c"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_5j0w6"]
radius = 0.252441
height = 1.89893
[sub_resource type="GDScript" id="GDScript_yaurm"]
script/source = "extends Node3D
@export var scene : PackedScene
func emit():
var instance : Node3D = scene.instantiate()
instance.position = global_position
instance.rotation = global_rotation
get_tree().current_scene.add_child(instance)
"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_yaurm"]
animation = &"RESET"
@ -84,21 +92,47 @@ transitions = ["Start", "idle", SubResource("AnimationNodeStateMachineTransition
graph_offset = Vector2(-228.371, 13.6511)
[sub_resource type="BoxShape3D" id="BoxShape3D_1p07c"]
size = Vector3(0.674805, 1.01257, 0.948242)
size = Vector3(0.674805, 1.01257, 0.494141)
[sub_resource type="GDScript" id="GDScript_yaurm"]
script/source = "extends Node3D
@export var scene : PackedScene
func emit():
var instance : Node3D = scene.instantiate()
instance.position = global_position
instance.rotation = global_rotation
get_tree().current_scene.add_child(instance)
"
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_5j0w6"]
radius = 0.252441
height = 1.89893
[node name="PlayerBody" type="PlayerBody"]
collision_layer = 8
collision_mask = 9
[node name="GroundCracksEmitter" type="Node3D" parent="."]
script = SubResource("GDScript_yaurm")
scene = ExtResource("2_1p07c")
[node name="AnimationTree" type="AnimationTree" parent="."]
unique_name_in_owner = true
root_node = NodePath("%AnimationTree/../character")
root_motion_track = NodePath("character/Skeleton3D:root")
root_motion_local = false
tree_root = SubResource("AnimationNodeStateMachine_yaurm")
anim_player = NodePath("../character/AnimationPlayer")
[node name="character" parent="." instance=ExtResource("1_yaurm")]
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="character/character/Skeleton3D" index="2"]
transform = Transform3D(-0.746199, -0.665027, 0.0304134, 0.664505, -0.746819, -0.0263565, 0.0402411, 0.000542633, 0.99919, 0.636185, 2.03465, -0.142065)
bone_name = "hammer_2"
bone_idx = 18
[node name="DamageBox" type="DamageBox" parent="character/character/Skeleton3D/BoneAttachment3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.008875, 1.58642, -6.97582e-10)
collision_layer = 0
collision_mask = 3
input_ray_pickable = false
monitoring = false
monitorable = false
priority = 1
[node name="CollisionShape3D" type="CollisionShape3D" parent="character/character/Skeleton3D/BoneAttachment3D/DamageBox"]
transform = Transform3D(1.00001, -4.01926e-07, -4.32134e-07, 6.76648e-07, 1, 4.55242e-07, -2.16067e-07, -1.23109e-07, 1.00001, -5.96046e-08, -0.196067, -0.0270205)
shape = SubResource("BoxShape3D_1p07c")
[node name="PlayerIdleState" type="PlayerIdleState" parent="."]
@ -124,35 +158,4 @@ input_next_margin = 0.0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.949463, 0)
shape = SubResource("CapsuleShape3D_5j0w6")
[node name="AnimationTree" type="AnimationTree" parent="."]
unique_name_in_owner = true
root_node = NodePath("%AnimationTree/../character")
root_motion_track = NodePath("character/Skeleton3D:root")
root_motion_local = false
tree_root = SubResource("AnimationNodeStateMachine_yaurm")
anim_player = NodePath("../character/AnimationPlayer")
[node name="character" parent="." instance=ExtResource("1_yaurm")]
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="character/character/Skeleton3D" index="2"]
transform = Transform3D(-0.746199, -0.665027, 0.0304134, 0.664505, -0.746819, -0.0263565, 0.0402411, 0.000542633, 0.99919, 0.636185, 2.03465, -0.142065)
bone_name = "hammer_2"
bone_idx = 18
[node name="DamageBox" type="DamageBox" parent="character/character/Skeleton3D/BoneAttachment3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.008875, 1.58642, -6.97582e-10)
collision_layer = 0
collision_mask = 3
input_ray_pickable = false
monitoring = false
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="character/character/Skeleton3D/BoneAttachment3D/DamageBox"]
transform = Transform3D(1, -1.19209e-07, -5.88596e-07, 4.76837e-07, 1, 4.24683e-07, -2.16067e-07, -7.45058e-08, 1, 0, -0.196067, -0.0270205)
shape = SubResource("BoxShape3D_1p07c")
[node name="GroundCracksEmitter" type="Node3D" parent="."]
script = SubResource("GDScript_yaurm")
scene = ExtResource("2_1p07c")
[editable path="character"]

View file

@ -53,8 +53,10 @@ light_attack={
3d_render/layer_1="Default"
3d_render/layer_2="Terrain"
3d_render/layer_3="Characters"
3d_physics/layer_1="Movement"
3d_physics/layer_1="Environment"
3d_physics/layer_2="Hitboxes"
3d_physics/layer_3="Effects"
3d_physics/layer_4="Character Physics"
[physics]