test_moving_platform.tscn 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. [gd_scene load_steps=15 format=3 uid="uid://dgh5drb4q81kh"]
  2. [ext_resource type="Script" uid="uid://cx8vo58lobtgu" path="res://utils/camera_orbit.gd" id="1"]
  3. [ext_resource type="Script" uid="uid://uo2swke2y6v8" path="res://tests/functional/test_moving_platform.gd" id="2"]
  4. [ext_resource type="PackedScene" uid="uid://b1ihqm3x8jru" path="res://tests/test_options.tscn" id="3"]
  5. [ext_resource type="Script" uid="uid://ckob04lrcf4w" path="res://utils/characterbody_physics.gd" id="4"]
  6. [sub_resource type="CapsuleShape3D" id="1"]
  7. radius = 0.3
  8. [sub_resource type="BoxShape3D" id="2"]
  9. size = Vector3(0.6, 1.6, 0.6)
  10. [sub_resource type="CylinderShape3D" id="3"]
  11. height = 1.60005
  12. radius = 0.3
  13. [sub_resource type="SphereShape3D" id="4"]
  14. radius = 0.79945
  15. [sub_resource type="ConvexPolygonShape3D" id="5"]
  16. points = PackedVector3Array(-0.7, 0, -0.7, -0.3, 0, 0.8, 0.8, 0, -0.3, 0, -0.8, 0)
  17. [sub_resource type="PhysicsMaterial" id="7"]
  18. [sub_resource type="BoxShape3D" id="8"]
  19. size = Vector3(4, 0.4, 2)
  20. [sub_resource type="Animation" id="9"]
  21. length = 9.0
  22. loop_mode = 1
  23. tracks/0/type = "value"
  24. tracks/0/imported = false
  25. tracks/0/enabled = true
  26. tracks/0/path = NodePath(".:position")
  27. tracks/0/interp = 2
  28. tracks/0/loop_wrap = true
  29. tracks/0/keys = {
  30. "times": PackedFloat32Array(0, 4.5),
  31. "transitions": PackedFloat32Array(1, 1),
  32. "update": 0,
  33. "values": [Vector3(-7, -4.235, 0), Vector3(7, -4.235, 0)]
  34. }
  35. [sub_resource type="Animation" id="Animation_jtts3"]
  36. length = 0.001
  37. tracks/0/type = "value"
  38. tracks/0/imported = false
  39. tracks/0/enabled = true
  40. tracks/0/path = NodePath(".:position")
  41. tracks/0/interp = 1
  42. tracks/0/loop_wrap = true
  43. tracks/0/keys = {
  44. "times": PackedFloat32Array(0),
  45. "transitions": PackedFloat32Array(1),
  46. "update": 0,
  47. "values": [Vector3(-7, -4.235, 0)]
  48. }
  49. [sub_resource type="AnimationLibrary" id="AnimationLibrary_jtts3"]
  50. _data = {
  51. &"Move": SubResource("9"),
  52. &"RESET": SubResource("Animation_jtts3")
  53. }
  54. [node name="Test2" type="Node3D"]
  55. script = ExtResource("2")
  56. [node name="LabelBodyType" type="Label" parent="."]
  57. offset_left = 14.0
  58. offset_top = 78.0
  59. offset_right = 171.0
  60. offset_bottom = 92.0
  61. text = "Body Type: "
  62. [node name="Options" parent="." instance=ExtResource("3")]
  63. offset_top = 153.0
  64. offset_right = 134.0
  65. offset_bottom = 182.0
  66. [node name="Bodies" type="Node3D" parent="."]
  67. [node name="CharacterBody3D" type="CharacterBody3D" parent="Bodies"]
  68. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.18538, 0)
  69. collision_layer = 2
  70. script = ExtResource("4")
  71. _stop_on_slopes = true
  72. use_snap = true
  73. [node name="Capsule" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  74. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  75. shape = SubResource("1")
  76. debug_color = Color(1, 1, 0, 1)
  77. [node name="Box" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  78. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  79. shape = SubResource("2")
  80. debug_color = Color(1, 1, 0, 1)
  81. [node name="Cylinder" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  82. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  83. shape = SubResource("3")
  84. debug_color = Color(1, 1, 0, 1)
  85. [node name="Sphere" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  86. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  87. shape = SubResource("4")
  88. debug_color = Color(1, 1, 0, 1)
  89. [node name="Convex" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  90. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  91. shape = SubResource("5")
  92. debug_color = Color(1, 1, 0, 1)
  93. [node name="RigidBody" type="RigidBody3D" parent="Bodies"]
  94. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.18538, 0)
  95. collision_layer = 4
  96. axis_lock_angular_x = true
  97. axis_lock_angular_y = true
  98. axis_lock_angular_z = true
  99. physics_material_override = SubResource("7")
  100. [node name="Capsule" type="CollisionShape3D" parent="Bodies/RigidBody"]
  101. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  102. shape = SubResource("1")
  103. debug_color = Color(1, 1, 0, 1)
  104. [node name="Box" type="CollisionShape3D" parent="Bodies/RigidBody"]
  105. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  106. shape = SubResource("2")
  107. debug_color = Color(1, 1, 0, 1)
  108. [node name="Cylinder" type="CollisionShape3D" parent="Bodies/RigidBody"]
  109. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  110. shape = SubResource("3")
  111. debug_color = Color(1, 1, 0, 1)
  112. [node name="Sphere" type="CollisionShape3D" parent="Bodies/RigidBody"]
  113. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  114. shape = SubResource("4")
  115. debug_color = Color(1, 1, 0, 1)
  116. [node name="Convex" type="CollisionShape3D" parent="Bodies/RigidBody"]
  117. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  118. shape = SubResource("5")
  119. debug_color = Color(1, 1, 0, 1)
  120. [node name="Platforms" type="Node3D" parent="."]
  121. [node name="MovingPlatform" type="AnimatableBody3D" parent="Platforms"]
  122. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.235, 0)
  123. [node name="CollisionShape" type="CollisionShape3D" parent="Platforms/MovingPlatform"]
  124. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0)
  125. shape = SubResource("8")
  126. debug_color = Color(0.533333, 0, 1, 1)
  127. [node name="AnimationPlayer" type="AnimationPlayer" parent="Platforms/MovingPlatform"]
  128. libraries = {
  129. &"": SubResource("AnimationLibrary_jtts3")
  130. }
  131. [node name="Camera3D" type="Camera3D" parent="."]
  132. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
  133. current = true
  134. script = ExtResource("1")