Browse Source

:wrench: Make the box dynamic

DricomDragon 1 year ago
parent
commit
ccaff09d00

+ 10 - 3
godot/component/entity/props/box/box.tscn

@@ -1,11 +1,18 @@
-[gd_scene load_steps=3 format=3 uid="uid://bcpri2x5afoyb"]
+[gd_scene load_steps=4 format=3 uid="uid://bcpri2x5afoyb"]
 
 [ext_resource type="PackedScene" uid="uid://bii08dedmqwkm" path="res://component/entity/props/box/CubeContainer.glb" id="1_n6b7q"]
 
+[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_ldttd"]
+friction = 0.9
+bounce = 0.2
+
 [sub_resource type="BoxShape3D" id="BoxShape3D_v0rct"]
 
-[node name="Box" type="StaticBody3D"]
-collision_mask = 0
+[node name="Box" type="RigidBody3D"]
+collision_layer = 16
+collision_mask = 31
+mass = 35.0
+physics_material_override = SubResource("PhysicsMaterial_ldttd")
 
 [node name="Shape" type="CollisionShape3D" parent="."]
 shape = SubResource("BoxShape3D_v0rct")

+ 1 - 1
godot/component/entity/vehicles/jeep/Jeep.tscn

@@ -13,7 +13,7 @@ size = Vector3(0.28984, 1.56027, 0.993305)
 [node name="Jeep" type="VehicleBody3D" groups=["vehicle"]]
 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.623038, 0)
 collision_layer = 8
-collision_mask = 11
+collision_mask = 27
 mass = 400.0
 center_of_mass_mode = 1
 center_of_mass = Vector3(0, 0.06, 0)

+ 1 - 1
godot/component/entity/walker/walker.tscn

@@ -8,7 +8,7 @@ size = Vector3(0.56, 0.8, 0.4)
 
 [node name="Walker" type="CharacterBody3D"]
 collision_layer = 2
-collision_mask = 13
+collision_mask = 29
 script = ExtResource("1_xg6by")
 
 [node name="BasicPlayerModel" parent="." instance=ExtResource("2_p2xjj")]

+ 1 - 0
godot/project.godot

@@ -106,6 +106,7 @@ locale/locale_filter_mode=1
 3d_physics/layer_2="player"
 3d_physics/layer_3="danger"
 3d_physics/layer_4="vehicle"
+3d_physics/layer_5="props"
 
 [rendering]