test_moving_platform.tscn 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. [gd_scene load_steps=13 format=3 uid="uid://dgh5drb4q81kh"]
  2. [ext_resource type="Script" path="res://utils/camera_orbit.gd" id="1"]
  3. [ext_resource type="Script" 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" 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. radius = 0.3
  12. height = 1.60005
  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. [node name="Test2" type="Node3D"]
  23. script = ExtResource( "2" )
  24. [node name="LabelBodyType" type="Label" parent="."]
  25. offset_left = 14.0
  26. offset_top = 78.0
  27. offset_right = 171.0
  28. offset_bottom = 92.0
  29. text = "Body Type: "
  30. __meta__ = {
  31. "_edit_use_anchors_": false
  32. }
  33. [node name="Options" parent="." instance=ExtResource( "3" )]
  34. offset_top = 153.0
  35. offset_right = 134.0
  36. offset_bottom = 182.0
  37. [node name="Bodies" type="Node3D" parent="."]
  38. [node name="CharacterBody3D" type="CharacterBody3D" parent="Bodies"]
  39. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.18538, 0)
  40. collision_layer = 2
  41. script = ExtResource( "4" )
  42. _stop_on_slopes = true
  43. use_snap = true
  44. [node name="Capsule" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  45. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  46. shape = SubResource( "1" )
  47. [node name="Box" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  48. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  49. shape = SubResource( "2" )
  50. [node name="Cylinder" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  51. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  52. shape = SubResource( "3" )
  53. [node name="Sphere" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  54. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  55. shape = SubResource( "4" )
  56. [node name="Convex" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
  57. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  58. shape = SubResource( "5" )
  59. [node name="RigidBody" type="RigidDynamicBody3D" parent="Bodies"]
  60. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.18538, 0)
  61. collision_layer = 4
  62. axis_lock_angular_x = true
  63. axis_lock_angular_y = true
  64. axis_lock_angular_z = true
  65. physics_material_override = SubResource( "7" )
  66. [node name="Capsule" type="CollisionShape3D" parent="Bodies/RigidBody"]
  67. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  68. shape = SubResource( "1" )
  69. [node name="Box" type="CollisionShape3D" parent="Bodies/RigidBody"]
  70. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  71. shape = SubResource( "2" )
  72. [node name="Cylinder" type="CollisionShape3D" parent="Bodies/RigidBody"]
  73. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  74. shape = SubResource( "3" )
  75. [node name="Sphere" type="CollisionShape3D" parent="Bodies/RigidBody"]
  76. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  77. shape = SubResource( "4" )
  78. [node name="Convex" type="CollisionShape3D" parent="Bodies/RigidBody"]
  79. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
  80. shape = SubResource( "5" )
  81. [node name="Platforms" type="Node3D" parent="."]
  82. [node name="MovingPlatform" type="AnimatableBody3D" parent="Platforms"]
  83. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.235, 0)
  84. [node name="CollisionShape" type="CollisionShape3D" parent="Platforms/MovingPlatform"]
  85. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0)
  86. shape = SubResource( "8" )
  87. [node name="AnimationPlayer" type="AnimationPlayer" parent="Platforms/MovingPlatform"]
  88. anims/Move = SubResource( "9" )
  89. [node name="Camera3D" type="Camera3D" parent="."]
  90. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
  91. current = true
  92. script = ExtResource( "1" )
  93. [node name="OmniLight" type="OmniLight3D" parent="Camera3D"]
  94. omni_range = 50.0