Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b792e8721c | |||
| 2e2df4ff50 | |||
| a84e0ecfb3 | |||
| f828c1d786 | |||
| a98785abec | |||
| 7c4e541446 | |||
| 7d31d17034 | |||
| 2ff8cc74cc | |||
| fabafbb35b |
@@ -69,11 +69,11 @@ jobs:
|
|||||||
# mkdir -v -p build/linux
|
# mkdir -v -p build/linux
|
||||||
# godot --headless --verbose --export-release "Linux/X11" build/linux/${{ env.GAME_NAME }}.x86_64
|
# godot --headless --verbose --export-release "Linux/X11" build/linux/${{ env.GAME_NAME }}.x86_64
|
||||||
# zip -r Linux.zip build/linux
|
# zip -r Linux.zip build/linux
|
||||||
# - name: Mac Build
|
- name: Mac Build
|
||||||
# run: |
|
run: |
|
||||||
# mkdir -v -p build/mac
|
mkdir -v -p build/mac
|
||||||
# godot --headless --verbose --export-release "macOS" build/mac/${{ env.GAME_NAME }}.zip
|
godot --headless --verbose --export-release "macOS" build/mac/${{ env.GAME_NAME }}.zip
|
||||||
# zip -r Mac.zip build/mac
|
zip -r Mac.zip build/mac
|
||||||
|
|
||||||
- name: Upload to Itch
|
- name: Upload to Itch
|
||||||
uses: KikimoraGames/itch-publish@v0.0.3
|
uses: KikimoraGames/itch-publish@v0.0.3
|
||||||
@@ -102,12 +102,12 @@ jobs:
|
|||||||
# buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
|
# buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
|
||||||
# gameData: Linux.zip
|
# gameData: Linux.zip
|
||||||
# buildChannel: linux
|
# buildChannel: linux
|
||||||
# - name: Upload to Itch
|
- name: Upload to Itch
|
||||||
# uses: KikimoraGames/itch-publish@v0.0.3
|
uses: KikimoraGames/itch-publish@v0.0.3
|
||||||
# with:
|
with:
|
||||||
# butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
|
butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
|
||||||
# itchUsername: ${{ env.ITCHIO_USERNAME }}
|
itchUsername: ${{ env.ITCHIO_USERNAME }}
|
||||||
# itchGameId: ${{ env.ITCHIO_GAMEID }}
|
itchGameId: ${{ env.ITCHIO_GAMEID }}
|
||||||
# buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
|
buildNumber: ${{ needs.BumpTag.outputs.tag_name }}
|
||||||
# gameData: Mac.zip
|
gameData: Mac.zip
|
||||||
# buildChannel: mac
|
buildChannel: mac
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ var credits_scene
|
|||||||
var sub_menu
|
var sub_menu
|
||||||
|
|
||||||
func load_game_scene() -> void:
|
func load_game_scene() -> void:
|
||||||
|
GUIDE.disable_mapping_context(menu_context)
|
||||||
SceneLoader.load_scene(game_scene_path)
|
SceneLoader.load_scene(game_scene_path)
|
||||||
|
|
||||||
func new_game() -> void:
|
func new_game() -> void:
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ glow_enabled = true
|
|||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("1_1s2y7")]
|
[node name="Player" parent="." instance=ExtResource("1_1s2y7")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1.5)
|
||||||
|
TutorialDone = true
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
environment = SubResource("Environment_1bvp3")
|
environment = SubResource("Environment_1bvp3")
|
||||||
@@ -49,7 +50,7 @@ collision_layer = 3
|
|||||||
collision_mask = 5
|
collision_mask = 5
|
||||||
|
|
||||||
[node name="CSGBox3D" type="CSGBox3D" parent="Greybox"]
|
[node name="CSGBox3D" type="CSGBox3D" parent="Greybox"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.09619, -0.472656, -46.3293)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.096, -0.5, -46.329)
|
||||||
use_collision = true
|
use_collision = true
|
||||||
size = Vector3(100, 1, 190.741)
|
size = Vector3(100, 1, 190.741)
|
||||||
material = ExtResource("3_vvhq3")
|
material = ExtResource("3_vvhq3")
|
||||||
@@ -399,3 +400,205 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, 4.5, -11.5)
|
|||||||
use_collision = true
|
use_collision = true
|
||||||
size = Vector3(1, 0.5, 5)
|
size = Vector3(1, 0.5, 5)
|
||||||
material = ExtResource("3_vvhq3")
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="Mantles" type="CSGCombiner3D" parent="Greybox"]
|
||||||
|
|
||||||
|
[node name="Label3D22" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -5.5, 0.1, 11)
|
||||||
|
text = "0.5m"
|
||||||
|
|
||||||
|
[node name="Label3D35" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -8.5, 0.1, 11)
|
||||||
|
text = "0.25m"
|
||||||
|
|
||||||
|
[node name="Label3D23" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -2, 0.1, 11)
|
||||||
|
text = "1m"
|
||||||
|
|
||||||
|
[node name="Label3D27" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 12.5)
|
||||||
|
text = "1m"
|
||||||
|
|
||||||
|
[node name="Label3D28" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 12.5)
|
||||||
|
text = "1m"
|
||||||
|
|
||||||
|
[node name="Label3D29" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 21)
|
||||||
|
text = "2m"
|
||||||
|
|
||||||
|
[node name="Label3D30" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 28.5)
|
||||||
|
text = "3m"
|
||||||
|
|
||||||
|
[node name="Label3D31" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 21)
|
||||||
|
text = "2m"
|
||||||
|
|
||||||
|
[node name="Label3D32" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 28.5)
|
||||||
|
text = "3m"
|
||||||
|
|
||||||
|
[node name="Label3D24" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 2, 0.1, 11)
|
||||||
|
text = "1.5m"
|
||||||
|
|
||||||
|
[node name="Label3D25" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 6, 0.1, 11)
|
||||||
|
text = "2m"
|
||||||
|
|
||||||
|
[node name="Label3D26" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 10, 0.1, 11)
|
||||||
|
text = "4m"
|
||||||
|
|
||||||
|
[node name="CSGBox3D33" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0.5, 12.5)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 1, 1)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D34" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 0.5, 12.25)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 1, 0.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D35" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0.5, 12.75)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 1, 1.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D36" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0.5, 13)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 1, 2)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D37" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0.5, 14)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 1, 4)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D38" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1, 20.5)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 2, 1)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D39" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 1, 20.25)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 2, 0.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D40" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 20.75)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 2, 1.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D41" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 1, 21)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 2, 2)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D42" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 1, 22)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 2, 4)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D43" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1.5, 28.5)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 3, 1)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D44" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 1.5, 28.25)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 3, 0.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D45" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1.5, 28.75)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 3, 1.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D46" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 1.5, 29)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 3, 2)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D47" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 1.5, 30)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 3, 4)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="Label3D33" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, 13, 0.1, 36.5)
|
||||||
|
text = "4m"
|
||||||
|
|
||||||
|
[node name="Label3D34" type="Label3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(-5, 4.3711395e-07, 1.9106861e-14, 0, -2.18557e-07, 5, 4.3711395e-07, 5, 2.18557e-07, -11, 0.1, 36.5)
|
||||||
|
text = "4m"
|
||||||
|
|
||||||
|
[node name="CSGBox3D48" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 2, 36.5)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 4, 1)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D49" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 2, 36.25)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 4, 0.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D53" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 0.5, 12.125)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 1, 0.25)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D54" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 1, 20.125)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 2, 0.25)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D55" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 1.5, 28.125)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 3, 0.25)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D56" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.5, 2, 36.125)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(3, 4, 0.25)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D50" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 36.75)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 4, 1.5)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D51" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 2, 37)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 4, 2)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|
||||||
|
[node name="CSGBox3D52" type="CSGBox3D" parent="Greybox/Mantles"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 2, 38)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4, 4, 4)
|
||||||
|
material = ExtResource("3_vvhq3")
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ size = Vector3(12, 11.5, 5)
|
|||||||
size = Vector3(12, 13, 7)
|
size = Vector3(12, 13, 7)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_lnjrw"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_lnjrw"]
|
||||||
size = Vector3(14, 15.5, 13.5)
|
size = Vector3(14, 10, 13.5)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_3w3wd"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_3w3wd"]
|
||||||
size = Vector3(13, 16.5, 11.5)
|
size = Vector3(13, 16.5, 11.5)
|
||||||
@@ -102,7 +102,6 @@ player = NodePath("../Player")
|
|||||||
pause = ExtResource("10_0ari0")
|
pause = ExtResource("10_0ari0")
|
||||||
|
|
||||||
[node name="TutorialController" type="Control" parent="."]
|
[node name="TutorialController" type="Control" parent="."]
|
||||||
visible = false
|
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -140,6 +139,7 @@ theme_override_constants/margin_bottom = 10
|
|||||||
|
|
||||||
[node name="TutoMoveAndLook" type="VBoxContainer" parent="TutorialController/PanelContainer/MarginContainer"]
|
[node name="TutoMoveAndLook" type="VBoxContainer" parent="TutorialController/PanelContainer/MarginContainer"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_constants/separation = 0
|
theme_override_constants/separation = 0
|
||||||
|
|
||||||
@@ -318,10 +318,9 @@ shape = SubResource("BoxShape3D_3wccx")
|
|||||||
|
|
||||||
[node name="TutoDash2" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
|
[node name="TutoDash2" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
|
||||||
transform = Transform3D(0.14133325, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133325, 28.885735, 27.749329, 25.360323)
|
transform = Transform3D(0.14133325, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133325, 28.885735, 27.749329, 25.360323)
|
||||||
first_input_texture = ExtResource("16_crf87")
|
first_input_texture = ExtResource("19_efsse")
|
||||||
second_input_texture = ExtResource("19_efsse")
|
complex_input_text = "against wall"
|
||||||
complex_input_text = "in air"
|
tuto_text = "Wall run"
|
||||||
tuto_text = "Dash"
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoDash2"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoDash2"]
|
||||||
transform = Transform3D(1.0000031, 0, -4.917383e-07, 0, 1, 0, 4.917383e-07, 0, 1.0000031, 5.500023, 5, 0)
|
transform = Transform3D(1.0000031, 0, -4.917383e-07, 0, 1, 0, 4.917383e-07, 0, 1.0000031, 5.500023, 5, 0)
|
||||||
@@ -333,7 +332,7 @@ collision_layer = 0
|
|||||||
collision_mask = 16
|
collision_mask = 16
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWeaponThrow"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWeaponThrow"]
|
||||||
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 4.4208603, 7, -4.632329)
|
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 4.4208603, 9.75, -4.632329)
|
||||||
shape = SubResource("BoxShape3D_lnjrw")
|
shape = SubResource("BoxShape3D_lnjrw")
|
||||||
|
|
||||||
[node name="TriggerTutoEnjoy" type="Area3D" parent="TutoTriggers"]
|
[node name="TriggerTutoEnjoy" type="Area3D" parent="TutoTriggers"]
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ WalkSpeed = 7.5
|
|||||||
AccelerationAir = 2.0
|
AccelerationAir = 2.0
|
||||||
DecelerationAir = 0.1
|
DecelerationAir = 0.1
|
||||||
Weight = 5.0
|
Weight = 5.0
|
||||||
MantleTime = 0.3
|
MantleTime = 0.2
|
||||||
|
CoyoteTime = 0.3
|
||||||
SimpleJumpStartVelocity = 8.0
|
SimpleJumpStartVelocity = 8.0
|
||||||
SimpleJumpHangTimeInFrames = 1
|
SimpleJumpHangTimeInFrames = 1
|
||||||
SimpleJumpGravityLesseningFactor = 2.5
|
SimpleJumpGravityLesseningFactor = 2.5
|
||||||
@@ -84,6 +85,14 @@ PostDashSpeed = 30.0
|
|||||||
WallHugGravityLesseningFactor = 15.0
|
WallHugGravityLesseningFactor = 15.0
|
||||||
WallHugDownwardMaxSpeed = 8.0
|
WallHugDownwardMaxSpeed = 8.0
|
||||||
WallHugHorizontalDeceleration = 0.5
|
WallHugHorizontalDeceleration = 0.5
|
||||||
|
WallRunAltitudeLossSpeed = 12.0
|
||||||
|
WallRunSpeedThreshold = 10.0
|
||||||
|
|
||||||
|
[node name="WallRunSnapper" type="RayCast3D" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
transform = Transform3D(0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994, 0, 0, 0)
|
||||||
|
target_position = Vector3(0, 0, -5)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
[node name="InputController" type="Node3D" parent="."]
|
[node name="InputController" type="Node3D" parent="."]
|
||||||
script = ExtResource("16_v31n3")
|
script = ExtResource("16_v31n3")
|
||||||
@@ -121,6 +130,13 @@ CapsuleDefaultHeight = 1.7
|
|||||||
|
|
||||||
[node name="HeadSystem" parent="." instance=ExtResource("11_rxwoh")]
|
[node name="HeadSystem" parent="." instance=ExtResource("11_rxwoh")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
|
||||||
|
CameraInclineAcceleration = 20.0
|
||||||
|
GroundedCameraIncline = 3.0
|
||||||
|
|
||||||
|
[node name="MantleSystem" parent="HeadSystem" instance=ExtResource("8_qu4wy")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.6, 0)
|
||||||
|
MantleEndLocationDistanceFromWall = 0.3
|
||||||
|
MantleHeightCastStart = 2.5
|
||||||
|
|
||||||
[node name="StairsSystem" type="Node3D" parent="."]
|
[node name="StairsSystem" type="Node3D" parent="."]
|
||||||
script = ExtResource("7_bmt5a")
|
script = ExtResource("7_bmt5a")
|
||||||
@@ -132,10 +148,6 @@ target_position = Vector3(0, -0.55, 0)
|
|||||||
[node name="StairsBelowRayCast3D" type="RayCast3D" parent="."]
|
[node name="StairsBelowRayCast3D" type="RayCast3D" parent="."]
|
||||||
target_position = Vector3(0, -0.75, 0)
|
target_position = Vector3(0, -0.75, 0)
|
||||||
|
|
||||||
[node name="MantleSystem" parent="." instance=ExtResource("8_qu4wy")]
|
|
||||||
MantleEndLocationDistanceFromWall = 0.3
|
|
||||||
MantleHeightCastStart = 2.0
|
|
||||||
|
|
||||||
[node name="Bobbing" type="Node3D" parent="."]
|
[node name="Bobbing" type="Node3D" parent="."]
|
||||||
script = ExtResource("10_7wk1w")
|
script = ExtResource("10_7wk1w")
|
||||||
|
|
||||||
@@ -143,6 +155,7 @@ script = ExtResource("10_7wk1w")
|
|||||||
script = ExtResource("12_m2mxi")
|
script = ExtResource("12_m2mxi")
|
||||||
|
|
||||||
[node name="HeadCollisionDetectors" type="Node3D" parent="."]
|
[node name="HeadCollisionDetectors" type="Node3D" parent="."]
|
||||||
|
visible = false
|
||||||
|
|
||||||
[node name="HeadCollisionDetector0" type="RayCast3D" parent="HeadCollisionDetectors"]
|
[node name="HeadCollisionDetector0" type="RayCast3D" parent="HeadCollisionDetectors"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4, -0.210707)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4, -0.210707)
|
||||||
@@ -163,7 +176,7 @@ target_position = Vector3(0, 1, 0)
|
|||||||
[node name="TweenQueueSystem" parent="." instance=ExtResource("22_rpwev")]
|
[node name="TweenQueueSystem" parent="." instance=ExtResource("22_rpwev")]
|
||||||
|
|
||||||
[node name="WallHugSystem" type="Node3D" parent="."]
|
[node name="WallHugSystem" type="Node3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
visible = false
|
||||||
script = ExtResource("27_n7qhm")
|
script = ExtResource("27_n7qhm")
|
||||||
|
|
||||||
[node name="back" type="RayCast3D" parent="WallHugSystem"]
|
[node name="back" type="RayCast3D" parent="WallHugSystem"]
|
||||||
@@ -233,12 +246,10 @@ one_shot = true
|
|||||||
ignore_time_scale = true
|
ignore_time_scale = true
|
||||||
|
|
||||||
[node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")]
|
[node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")]
|
||||||
visible = false
|
|
||||||
offset_left = 1524.0
|
offset_left = 1524.0
|
||||||
offset_top = 1.0
|
offset_top = 1.0
|
||||||
offset_right = -8.0
|
offset_right = -8.0
|
||||||
offset_bottom = 1.0
|
offset_bottom = 1.0
|
||||||
enabled = false
|
|
||||||
initial_node_to_watch = NodePath("../StateChart")
|
initial_node_to_watch = NodePath("../StateChart")
|
||||||
|
|
||||||
[node name="UI" type="Control" parent="."]
|
[node name="UI" type="Control" parent="."]
|
||||||
@@ -491,45 +502,45 @@ delay_in_seconds = "0.0"
|
|||||||
script = ExtResource("26_infe6")
|
script = ExtResource("26_infe6")
|
||||||
initial_state = NodePath("SimpleJump")
|
initial_state = NodePath("SimpleJump")
|
||||||
|
|
||||||
|
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement/Jump"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../Mantling")
|
||||||
|
event = &"mantle"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="SimpleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
|
[node name="SimpleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
|
|
||||||
script = ExtResource("28_n7qhm")
|
|
||||||
to = NodePath("../../MegaJump")
|
|
||||||
event = &"megajump"
|
|
||||||
delay_in_seconds = "0.0"
|
|
||||||
|
|
||||||
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
|
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
|
||||||
script = ExtResource("28_n7qhm")
|
script = ExtResource("28_n7qhm")
|
||||||
to = NodePath("../../../Airborne/DoubleJumpEnabled")
|
to = NodePath("../../../Airborne/DoubleJumpEnabled")
|
||||||
event = &"jump_ended"
|
event = &"jump_ended"
|
||||||
delay_in_seconds = "0.0"
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="DoubleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
|
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
|
||||||
script = ExtResource("27_34snm")
|
|
||||||
|
|
||||||
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
|
|
||||||
script = ExtResource("28_n7qhm")
|
script = ExtResource("28_n7qhm")
|
||||||
to = NodePath("../../MegaJump")
|
to = NodePath("../../MegaJump")
|
||||||
event = &"megajump"
|
event = &"megajump"
|
||||||
delay_in_seconds = "0.0"
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="DoubleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
|
||||||
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
|
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
|
||||||
script = ExtResource("28_n7qhm")
|
script = ExtResource("28_n7qhm")
|
||||||
to = NodePath("../../../Airborne/Falling")
|
to = NodePath("../../../Airborne/Falling")
|
||||||
event = &"jump_ended"
|
event = &"jump_ended"
|
||||||
delay_in_seconds = "0.0"
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../MegaJump")
|
||||||
|
event = &"megajump"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="MegaJump" type="Node" parent="StateChart/Root/Movement/Jump"]
|
[node name="MegaJump" type="Node" parent="StateChart/Root/Movement/Jump"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/MegaJump"]
|
|
||||||
script = ExtResource("28_n7qhm")
|
|
||||||
to = NodePath("../../../Airborne/Falling")
|
|
||||||
event = &"jump_ended"
|
|
||||||
delay_in_seconds = "0.0"
|
|
||||||
|
|
||||||
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
|
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
|
||||||
script = ExtResource("26_infe6")
|
script = ExtResource("26_infe6")
|
||||||
initial_state = NodePath("Dash")
|
initial_state = NodePath("Dash")
|
||||||
@@ -593,15 +604,9 @@ initial_state = NodePath("CoyoteEnabled")
|
|||||||
script = ExtResource("41_ruloh")
|
script = ExtResource("41_ruloh")
|
||||||
default_state = NodePath("../CoyoteEnabled")
|
default_state = NodePath("../CoyoteEnabled")
|
||||||
|
|
||||||
[node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
|
||||||
script = ExtResource("28_n7qhm")
|
|
||||||
to = NodePath("../../OnWall/Hugging")
|
|
||||||
event = &"wall_hug"
|
|
||||||
delay_in_seconds = "0.0"
|
|
||||||
|
|
||||||
[node name="OnWallRun" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
[node name="OnWallRun" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
||||||
script = ExtResource("28_n7qhm")
|
script = ExtResource("28_n7qhm")
|
||||||
to = NodePath("../../OnWall/Running")
|
to = NodePath("../../OnWall/RunningCoyoteEnabled")
|
||||||
event = &"wall_run"
|
event = &"wall_run"
|
||||||
delay_in_seconds = "0.0"
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
@@ -641,6 +646,12 @@ delay_in_seconds = "0.0"
|
|||||||
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
[node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../../OnWall/HuggingCoyoteEnabled")
|
||||||
|
event = &"wall_hug"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
|
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
|
||||||
script = ExtResource("28_n7qhm")
|
script = ExtResource("28_n7qhm")
|
||||||
to = NodePath("../../../Jump/MegaJump")
|
to = NodePath("../../../Jump/MegaJump")
|
||||||
@@ -656,6 +667,12 @@ delay_in_seconds = "0.0"
|
|||||||
[node name="Falling" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
[node name="Falling" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
[node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../../OnWall/HuggingCoyoteEnabled")
|
||||||
|
event = &"wall_hug"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="ToDoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"]
|
[node name="ToDoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"]
|
||||||
script = ExtResource("28_n7qhm")
|
script = ExtResource("28_n7qhm")
|
||||||
to = NodePath("../../DoubleJumpEnabled")
|
to = NodePath("../../DoubleJumpEnabled")
|
||||||
@@ -678,12 +695,6 @@ to = NodePath("../../Grounded")
|
|||||||
event = &"grounded"
|
event = &"grounded"
|
||||||
delay_in_seconds = "0.0"
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
|
||||||
script = ExtResource("28_n7qhm")
|
|
||||||
to = NodePath("../../Jump/SimpleJump")
|
|
||||||
event = &"jump"
|
|
||||||
delay_in_seconds = "0.0"
|
|
||||||
|
|
||||||
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
||||||
script = ExtResource("28_n7qhm")
|
script = ExtResource("28_n7qhm")
|
||||||
to = NodePath("../../Jump/MegaJump")
|
to = NodePath("../../Jump/MegaJump")
|
||||||
@@ -696,15 +707,69 @@ to = NodePath("../../Airborne/Reset")
|
|||||||
event = &"start_falling"
|
event = &"start_falling"
|
||||||
delay_in_seconds = "0.0"
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../Mantling")
|
||||||
|
event = &"mantle"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="HuggingCoyoteEnabled" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
||||||
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
[node name="OnExpiration" type="Node" parent="StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../Hugging")
|
||||||
|
event = &"coyote_expired"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../../Jump/DoubleJump")
|
||||||
|
event = &"jump"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
[node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/Hugging"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../../Jump/SimpleJump")
|
||||||
|
event = &"jump"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="Hanging" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
[node name="Hanging" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/Hanging"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../../Jump/SimpleJump")
|
||||||
|
event = &"jump"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="RunningCoyoteEnabled" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
||||||
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/RunningCoyoteEnabled"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../../Jump/DoubleJump")
|
||||||
|
event = &"jump"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="OnExpiration" type="Node" parent="StateChart/Root/Movement/OnWall/RunningCoyoteEnabled"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../Running")
|
||||||
|
event = &"coyote_expired"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="Running" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
[node name="Running" type="Node" parent="StateChart/Root/Movement/OnWall"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall/Running"]
|
||||||
|
script = ExtResource("28_n7qhm")
|
||||||
|
to = NodePath("../../../Jump/SimpleJump")
|
||||||
|
event = &"jump"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"]
|
[connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"]
|
||||||
[connection signal="input_aim_down" from="InputController" to="." method="OnInputAimDown"]
|
[connection signal="input_aim_down" from="InputController" to="." method="OnInputAimDown"]
|
||||||
[connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"]
|
[connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"]
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Godot;
|
using Godot;
|
||||||
using GodotStateCharts;
|
using GodotStateCharts;
|
||||||
using Movementtests.addons.godot_state_charts.csharp;
|
using Movementtests.addons.godot_state_charts.csharp;
|
||||||
@@ -15,7 +14,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
MoveCamera,
|
MoveCamera,
|
||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
private bool _isUsingGamepad = false;
|
private bool _isUsingGamepad;
|
||||||
|
|
||||||
// User API to important child nodes.
|
// User API to important child nodes.
|
||||||
public HeadSystem HeadSystem;
|
public HeadSystem HeadSystem;
|
||||||
@@ -25,7 +24,6 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
public MantleSystem MantleSystem;
|
public MantleSystem MantleSystem;
|
||||||
public DashSystem DashSystem;
|
public DashSystem DashSystem;
|
||||||
public CapsuleCollider CapsuleCollider;
|
public CapsuleCollider CapsuleCollider;
|
||||||
public TweenQueueSystem TweenQueueSystem;
|
|
||||||
public Node3D WeaponRoot;
|
public Node3D WeaponRoot;
|
||||||
public WeaponSystem WeaponSystem;
|
public WeaponSystem WeaponSystem;
|
||||||
public WallHugSystem WallHugSystem;
|
public WallHugSystem WallHugSystem;
|
||||||
@@ -35,12 +33,15 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
public Node3D DashIndicatorNode;
|
public Node3D DashIndicatorNode;
|
||||||
public MeshInstance3D DashIndicatorMesh;
|
public MeshInstance3D DashIndicatorMesh;
|
||||||
public CylinderMesh DashIndicatorMeshCylinder;
|
public CylinderMesh DashIndicatorMeshCylinder;
|
||||||
|
public RayCast3D WallRunSnapper;
|
||||||
|
|
||||||
private bool _movementEnabled = true;
|
private bool _movementEnabled = true;
|
||||||
|
|
||||||
|
private Vector3 _dashDirection = Vector3.Zero;
|
||||||
|
|
||||||
private bool _shouldMantle;
|
private bool _shouldMantle;
|
||||||
private Vector3 _mantleLocation = Vector3.Zero;
|
private Vector3 _mantleLocation = Vector3.Zero;
|
||||||
private Vector3 _dashDirection = Vector3.Zero;
|
private Vector3 _preMantleVelocity = Vector3.Zero;
|
||||||
|
|
||||||
private float _lastFrameWasOnFloor = -Mathf.Inf;
|
private float _lastFrameWasOnFloor = -Mathf.Inf;
|
||||||
|
|
||||||
@@ -80,6 +81,8 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
[ExportGroup("Mantle")]
|
[ExportGroup("Mantle")]
|
||||||
[Export(PropertyHint.Range, "0,1,0.01,or_greater")]
|
[Export(PropertyHint.Range, "0,1,0.01,or_greater")]
|
||||||
public float MantleTime { get; set; } = 0.1f;
|
public float MantleTime { get; set; } = 0.1f;
|
||||||
|
[Export]
|
||||||
|
public PackedScene MantlePath { get; set; } = GD.Load<PackedScene>("res://scenes/path/Path.tscn");
|
||||||
|
|
||||||
// Jump
|
// Jump
|
||||||
[ExportGroup("Jump")]
|
[ExportGroup("Jump")]
|
||||||
@@ -154,6 +157,16 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
[Export(PropertyHint.Range, "0.1,10,0.1,or_greater")]
|
[Export(PropertyHint.Range, "0.1,10,0.1,or_greater")]
|
||||||
public float WallHugHorizontalDeceleration { get; set; } = 5f;
|
public float WallHugHorizontalDeceleration { get; set; } = 5f;
|
||||||
|
|
||||||
|
// Wall run
|
||||||
|
[ExportGroup("Wall run")]
|
||||||
|
[Export(PropertyHint.Range, "1,20,0.1,or_greater")]
|
||||||
|
public float WallRunUpwardVelocity { get; set; } = 10f;
|
||||||
|
[Export(PropertyHint.Range, "1,20,0.1,or_greater")]
|
||||||
|
public float WallRunAltitudeLossSpeed { get; set; } = 10f;
|
||||||
|
|
||||||
|
[Export(PropertyHint.Range, "1,20,0.1,or_greater")]
|
||||||
|
public float WallRunSpeedThreshold { get; set; } = 8f;
|
||||||
|
|
||||||
private float _targetSpeed;
|
private float _targetSpeed;
|
||||||
private float _gravity;
|
private float _gravity;
|
||||||
|
|
||||||
@@ -175,6 +188,11 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
private bool _canDash = true;
|
private bool _canDash = true;
|
||||||
private bool _shouldMantleOnDashEnded;
|
private bool _shouldMantleOnDashEnded;
|
||||||
|
|
||||||
|
private Vector3 _wallHugStartLocation = Vector3.Zero;
|
||||||
|
private Vector3 _wallHugStartNormal = Vector3.Zero;
|
||||||
|
private Vector3 _wallHugStartProjectedVelocity = Vector3.Zero;
|
||||||
|
private Vector3 _currentWallContactPoint = Vector3.Zero;
|
||||||
|
|
||||||
private StateChart _playerState;
|
private StateChart _playerState;
|
||||||
|
|
||||||
private StateChartState _aiming;
|
private StateChartState _aiming;
|
||||||
@@ -186,22 +204,31 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
private StateChartState _grounded;
|
private StateChartState _grounded;
|
||||||
private StateChartState _airborne;
|
private StateChartState _airborne;
|
||||||
private StateChartState _coyoteEnabled;
|
private StateChartState _coyoteEnabled;
|
||||||
|
// private StateChartState _doubleJumpEnabled;
|
||||||
private StateChartState _simpleJump;
|
private StateChartState _simpleJump;
|
||||||
private StateChartState _doubleJump;
|
private StateChartState _doubleJump;
|
||||||
private StateChartState _megaJump;
|
private StateChartState _megaJump;
|
||||||
|
private StateChartState _mantling;
|
||||||
private StateChartState _simpleDash;
|
private StateChartState _simpleDash;
|
||||||
private StateChartState _poweredDash;
|
private StateChartState _poweredDash;
|
||||||
private StateChartState _aimedDash;
|
private StateChartState _aimedDash;
|
||||||
private StateChartState _onWall;
|
private StateChartState _onWall;
|
||||||
private StateChartState _onWallHugging;
|
private StateChartState _onWallHugging;
|
||||||
|
private StateChartState _onWallHuggingCoyoteEnabled;
|
||||||
private StateChartState _onWallHanging;
|
private StateChartState _onWallHanging;
|
||||||
private StateChartState _onWallRunning;
|
private StateChartState _onWallRunning;
|
||||||
|
private StateChartState _onWallRunningCoyoteEnabled;
|
||||||
private Transition _onJumpFromWall;
|
|
||||||
|
private Transition _onJumpFromWallCoyote;
|
||||||
|
private Transition _onJumpFromWallRunCoyote;
|
||||||
|
private Transition _onJumpFromWall1;
|
||||||
|
private Transition _onJumpFromWall2;
|
||||||
|
private Transition _onJumpFromWall3;
|
||||||
private Transition _onMegajumpFromWall;
|
private Transition _onMegajumpFromWall;
|
||||||
|
|
||||||
private float _playerHeight;
|
private float _playerHeight;
|
||||||
private float _playerRadius;
|
private float _playerRadius;
|
||||||
|
private bool _isJumpInputPressed = false;
|
||||||
|
|
||||||
private float _lookSensitivityMultiplier = 1.0f;
|
private float _lookSensitivityMultiplier = 1.0f;
|
||||||
private float _mouseSensitivityMultiplier = 1.0f;
|
private float _mouseSensitivityMultiplier = 1.0f;
|
||||||
@@ -217,7 +244,6 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
|
||||||
// General use stuff
|
// General use stuff
|
||||||
TweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem");
|
|
||||||
PlayerUi = GetNode<PlayerUi>("UI");
|
PlayerUi = GetNode<PlayerUi>("UI");
|
||||||
// DashIndicator = GetNode<TextureRect>("%DashIndicator");
|
// DashIndicator = GetNode<TextureRect>("%DashIndicator");
|
||||||
PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
|
PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
|
||||||
@@ -239,13 +265,14 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth");
|
Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth");
|
||||||
|
|
||||||
// Movement stuff
|
// Movement stuff
|
||||||
WeaponRoot = GetNode<Node3D>("WeaponRoot");
|
WeaponRoot = GetNode<Node3D>("WeaponRoot");
|
||||||
WeaponSystem = GetNode<WeaponSystem>("WeaponRoot/WeaponSystem");
|
WeaponSystem = GetNode<WeaponSystem>("WeaponRoot/WeaponSystem");
|
||||||
MantleSystem = GetNode<MantleSystem>("MantleSystem");
|
MantleSystem = GetNode<MantleSystem>("HeadSystem/MantleSystem");
|
||||||
CapsuleCollider = GetNode<CapsuleCollider>("CapsuleCollider");
|
CapsuleCollider = GetNode<CapsuleCollider>("CapsuleCollider");
|
||||||
DashSystem = GetNode<DashSystem>("DashSystem");
|
DashSystem = GetNode<DashSystem>("DashSystem");
|
||||||
StairsSystem = GetNode<StairsSystem>("StairsSystem");
|
StairsSystem = GetNode<StairsSystem>("StairsSystem");
|
||||||
WallHugSystem = GetNode<WallHugSystem>("WallHugSystem");
|
WallHugSystem = GetNode<WallHugSystem>("WallHugSystem");
|
||||||
|
WallRunSnapper = GetNode<RayCast3D>("%WallRunSnapper");
|
||||||
RayCast3D stairsBelowRayCast3D = GetNode<RayCast3D>("StairsBelowRayCast3D");
|
RayCast3D stairsBelowRayCast3D = GetNode<RayCast3D>("StairsBelowRayCast3D");
|
||||||
RayCast3D stairsAheadRayCast3D = GetNode<RayCast3D>("StairsAheadRayCast3D");
|
RayCast3D stairsAheadRayCast3D = GetNode<RayCast3D>("StairsAheadRayCast3D");
|
||||||
_headCollisionDetectors = new RayCast3D[NUM_OF_HEAD_COLLISION_DETECTORS];
|
_headCollisionDetectors = new RayCast3D[NUM_OF_HEAD_COLLISION_DETECTORS];
|
||||||
@@ -270,20 +297,28 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_empowerOn = StateChartState.Of(GetNode("StateChart/Root/Empower/On"));
|
_empowerOn = StateChartState.Of(GetNode("StateChart/Root/Empower/On"));
|
||||||
_powerExpired = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Expired"));
|
_powerExpired = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Expired"));
|
||||||
_powerRecharging = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/AtLeastOneCharge"));
|
_powerRecharging = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/AtLeastOneCharge"));
|
||||||
_powerFull = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Full"));
|
_powerFull = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Full"));
|
||||||
|
|
||||||
_grounded = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded"));
|
_grounded = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded"));
|
||||||
_airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne"));
|
_airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne"));
|
||||||
_coyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/CoyoteEnabled"));
|
_coyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/CoyoteEnabled"));
|
||||||
|
// _doubleJumpEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/DoubleJumpEnabled"));
|
||||||
_simpleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/SimpleJump"));
|
_simpleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/SimpleJump"));
|
||||||
_doubleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/DoubleJump"));
|
_doubleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/DoubleJump"));
|
||||||
_megaJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/MegaJump"));
|
_megaJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/MegaJump"));
|
||||||
_onJumpFromWall = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/OnJump"));
|
_mantling = StateChartState.Of(GetNode("StateChart/Root/Movement/Mantling"));
|
||||||
|
_onJumpFromWallCoyote = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled/OnJump"));
|
||||||
|
_onJumpFromWallRunCoyote = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/RunningCoyoteEnabled/OnJump"));
|
||||||
|
_onJumpFromWall1 = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging/OnJump"));
|
||||||
|
_onJumpFromWall2 = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging/OnJump"));
|
||||||
|
_onJumpFromWall3 = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Running/OnJump"));
|
||||||
_onMegajumpFromWall = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/OnMegajump"));
|
_onMegajumpFromWall = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/OnMegajump"));
|
||||||
_onWall = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall"));
|
_onWall = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall"));
|
||||||
|
_onWallHuggingCoyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/HuggingCoyoteEnabled"));
|
||||||
_onWallHugging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging"));
|
_onWallHugging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging"));
|
||||||
_onWallHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging"));
|
_onWallHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging"));
|
||||||
_onWallRunning = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Running"));
|
_onWallRunning = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Running"));
|
||||||
|
_onWallRunningCoyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/RunningCoyoteEnabled"));
|
||||||
// State timers
|
// State timers
|
||||||
_powerCooldownTimer = GetNode<Timer>("PowerCooldown");
|
_powerCooldownTimer = GetNode<Timer>("PowerCooldown");
|
||||||
_timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir");
|
_timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir");
|
||||||
@@ -292,9 +327,6 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
///////////////////////////
|
///////////////////////////
|
||||||
// Initialize components //
|
// Initialize components //
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
|
||||||
// General use stuff
|
|
||||||
TweenQueueSystem.Init(this);
|
|
||||||
|
|
||||||
// Camera stuff
|
// Camera stuff
|
||||||
HeadSystem.Init();
|
HeadSystem.Init();
|
||||||
@@ -306,7 +338,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_gravity = (float)ProjectSettings.GetSetting("physics/3d/default_gravity");
|
_gravity = (float)ProjectSettings.GetSetting("physics/3d/default_gravity");
|
||||||
MantleSystem.Init();
|
MantleSystem.Init();
|
||||||
StairsSystem.Init(stairsBelowRayCast3D, stairsAheadRayCast3D, cameraSmooth);
|
StairsSystem.Init(stairsBelowRayCast3D, stairsAheadRayCast3D, cameraSmooth);
|
||||||
DashSystem.Init(HeadSystem, camera, TweenQueueSystem);
|
DashSystem.Init(HeadSystem, camera);
|
||||||
WeaponSystem.Init(HeadSystem, camera);
|
WeaponSystem.Init(HeadSystem, camera);
|
||||||
WallHugSystem.Init();
|
WallHugSystem.Init();
|
||||||
|
|
||||||
@@ -327,6 +359,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_grounded.StateEntered += OnGrounded;
|
_grounded.StateEntered += OnGrounded;
|
||||||
_grounded.StatePhysicsProcessing += HandleGrounded;
|
_grounded.StatePhysicsProcessing += HandleGrounded;
|
||||||
_airborne.StatePhysicsProcessing += HandleAirborne;
|
_airborne.StatePhysicsProcessing += HandleAirborne;
|
||||||
|
_onWall.StatePhysicsProcessing += HandleOnWall;
|
||||||
|
|
||||||
_coyoteEnabled.StateEntered += StartCoyoteTime;
|
_coyoteEnabled.StateEntered += StartCoyoteTime;
|
||||||
_timeScaleAimInAirTimer.Timeout += ResetTimeScale;
|
_timeScaleAimInAirTimer.Timeout += ResetTimeScale;
|
||||||
@@ -347,6 +380,9 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_megaJump.StateEntered += OnMegaJumpStarted;
|
_megaJump.StateEntered += OnMegaJumpStarted;
|
||||||
_megaJump.StatePhysicsProcessing += HandleMegaJump;
|
_megaJump.StatePhysicsProcessing += HandleMegaJump;
|
||||||
|
|
||||||
|
_mantling.StateEntered += OnMantleStarted;
|
||||||
|
_mantling.StatePhysicsProcessing += HandleMantling;
|
||||||
|
|
||||||
_simpleDash.StateEntered += OnSimpleDashStarted;
|
_simpleDash.StateEntered += OnSimpleDashStarted;
|
||||||
_simpleDash.StatePhysicsProcessing += HandleSimpleDash;
|
_simpleDash.StatePhysicsProcessing += HandleSimpleDash;
|
||||||
|
|
||||||
@@ -361,11 +397,19 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
|
|
||||||
_onWall.StateEntered += OnWallStarted;
|
_onWall.StateEntered += OnWallStarted;
|
||||||
_onWall.StateExited += OnWallStopped;
|
_onWall.StateExited += OnWallStopped;
|
||||||
|
_onWallHuggingCoyoteEnabled.StateEntered += OnWallHuggingStarted;
|
||||||
|
_onWallHuggingCoyoteEnabled.StatePhysicsProcessing += HandleWallHugging;
|
||||||
_onWallHugging.StatePhysicsProcessing += HandleWallHugging;
|
_onWallHugging.StatePhysicsProcessing += HandleWallHugging;
|
||||||
_onWallHanging.StatePhysicsProcessing += HandleWallHanging;
|
_onWallHanging.StatePhysicsProcessing += HandleWallHanging;
|
||||||
|
_onWallRunningCoyoteEnabled.StateEntered += OnWallRunningStarted;
|
||||||
|
_onWallRunningCoyoteEnabled.StatePhysicsProcessing += HandleWallRunning;
|
||||||
_onWallRunning.StatePhysicsProcessing += HandleWallRunning;
|
_onWallRunning.StatePhysicsProcessing += HandleWallRunning;
|
||||||
|
|
||||||
_onJumpFromWall.Taken += OnJumpFromWall;
|
_onJumpFromWallCoyote.Taken += OnJumpFromWallCoyote;
|
||||||
|
_onJumpFromWallRunCoyote.Taken += OnJumpFromWallCoyote;
|
||||||
|
_onJumpFromWall1.Taken += OnJumpFromWall;
|
||||||
|
_onJumpFromWall2.Taken += OnJumpFromWall;
|
||||||
|
_onJumpFromWall3.Taken += OnJumpFromWall;
|
||||||
_onMegajumpFromWall.Taken += OnMegajumpFromWall;
|
_onMegajumpFromWall.Taken += OnMegajumpFromWall;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,22 +463,29 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
{
|
{
|
||||||
_canDash = true;
|
_canDash = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsTryingToMantle()
|
||||||
|
{
|
||||||
|
return MantleSystem.IsMantlePossible && GetMoveInput().Z < -0.5f && _isJumpInputPressed;
|
||||||
|
}
|
||||||
|
|
||||||
public void HandleGrounded(float delta)
|
public void HandleGrounded(float delta)
|
||||||
{
|
{
|
||||||
MoveOnGround(delta);
|
MoveOnGround(delta);
|
||||||
|
// if (IsTryingToMantle()) _playerState.SendEvent("mantle");
|
||||||
if (!isOnFloorCustom())
|
if (!isOnFloorCustom())
|
||||||
_playerState.SendEvent("start_falling");
|
_playerState.SendEvent("start_falling");
|
||||||
}
|
}
|
||||||
|
|
||||||
private float _wallRunSpeedThreshold = 8f;
|
|
||||||
|
|
||||||
public void HandleAirborne(float delta)
|
public void HandleAirborne(float delta)
|
||||||
{
|
{
|
||||||
|
|
||||||
MoveInAir(delta);
|
MoveInAir(delta);
|
||||||
if (isOnFloorCustom())
|
if (isOnFloorCustom())
|
||||||
_playerState.SendEvent("grounded");
|
_playerState.SendEvent("grounded");
|
||||||
|
|
||||||
|
if (IsTryingToMantle()) _playerState.SendEvent("mantle");
|
||||||
|
|
||||||
if (!WallHugSystem.IsWallHugging())
|
if (!WallHugSystem.IsWallHugging())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -444,26 +495,40 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
|
|
||||||
// Should we start a wall run
|
// Should we start a wall run
|
||||||
var wallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Zero);
|
var wallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Zero);
|
||||||
|
var isIndeedWall = wallNormal.Y < 0.1;
|
||||||
var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
|
var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
|
||||||
var hvelProjected = hvel.Slide(_wallHugStartNormal);
|
var hvelProjected = hvel.Slide(_wallHugStartNormal);
|
||||||
var haveEnoughSpeed = hvelProjected.Length() > _wallRunSpeedThreshold;
|
var haveEnoughSpeed = hvelProjected.Length() > WallRunSpeedThreshold;
|
||||||
var isHeadPlanting = Velocity.AngleTo(wallNormal) < Math.PI / 4;
|
var isCoplanarEnough = Velocity.AngleTo(wallNormal) > Math.PI/4 && Velocity.AngleTo(wallNormal) < 3*Math.PI/4;
|
||||||
var isGoingDownwards = Velocity.AngleTo(Vector3.Down) < Math.PI / 4;
|
var isGoingDownwards = Velocity.AngleTo(Vector3.Down) < Math.PI/4;
|
||||||
if (haveEnoughSpeed && !isHeadPlanting && !isGoingDownwards)
|
if (haveEnoughSpeed && isCoplanarEnough && !isGoingDownwards && isIndeedWall && !_coyoteEnabled.Active)
|
||||||
{
|
{
|
||||||
|
SetVerticalVelocity(WallRunUpwardVelocity);
|
||||||
_playerState.SendEvent("wall_run");
|
_playerState.SendEvent("wall_run");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If all else fail and we go down, we hug
|
// If all else fail and we go down, we hug
|
||||||
if (Velocity.Y < 0)
|
if (Velocity.Y < 0 && !_coyoteEnabled.Active)
|
||||||
|
{
|
||||||
_playerState.SendEvent("wall_hug");
|
_playerState.SendEvent("wall_hug");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HandleOnWall(float delta)
|
||||||
|
{
|
||||||
|
if (IsTryingToMantle()) _playerState.SendEvent("mantle");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector3 _wallHugStartLocation = Vector3.Zero;
|
public void OnWallHuggingStarted()
|
||||||
private Vector3 _wallHugStartNormal = Vector3.Zero;
|
{
|
||||||
private Vector3 _wallHugStartProjectedVelocity = Vector3.Zero;
|
GetTree().CreateTimer(CoyoteTime).Timeout += CoyoteExpired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnWallRunningStarted()
|
||||||
|
{
|
||||||
|
GetTree().CreateTimer(CoyoteTime).Timeout += CoyoteExpired;
|
||||||
|
}
|
||||||
|
|
||||||
public void OnWallDetected()
|
public void OnWallDetected()
|
||||||
{
|
{
|
||||||
@@ -476,14 +541,15 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_wallHugStartNormal = newWallNormal;
|
_wallHugStartNormal = newWallNormal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float _timeSinceWallStarted;
|
|
||||||
|
|
||||||
public void OnWallStarted()
|
public void OnWallStarted()
|
||||||
{
|
{
|
||||||
|
if (!WallHugSystem.IsWallHugging())
|
||||||
|
return;
|
||||||
|
|
||||||
_wallHugStartNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Up);
|
_wallHugStartNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Up);
|
||||||
_wallHugStartLocation = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero) + _wallHugStartNormal * _playerRadius;
|
_currentWallContactPoint = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero);
|
||||||
|
_wallHugStartLocation = _currentWallContactPoint + _wallHugStartNormal * _playerRadius;
|
||||||
_wallHugStartProjectedVelocity = Velocity.Slide(_wallHugStartNormal);
|
_wallHugStartProjectedVelocity = Velocity.Slide(_wallHugStartNormal);
|
||||||
_timeSinceWallStarted = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnWallStopped()
|
public void OnWallStopped()
|
||||||
@@ -505,23 +571,25 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
WallHang(delta);
|
WallHang(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float _wallRunUpwardVelocity = 10f;
|
|
||||||
|
|
||||||
public void HandleWallRunning(float delta)
|
public void HandleWallRunning(float delta)
|
||||||
{
|
{
|
||||||
_timeSinceWallStarted += delta;
|
// Find horizontal velocity projected on the current wall
|
||||||
|
|
||||||
var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
|
var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
|
||||||
var hvelProjected = hvel.Slide(_wallHugStartNormal);
|
var hvelProjected = hvel.Slide(_wallHugStartNormal);
|
||||||
Velocity = hvelProjected + hvelProjected.Length()*Vector3.Up*0.3f/(1+_timeSinceWallStarted);
|
|
||||||
Velocity *= 0.99f;
|
|
||||||
|
|
||||||
// if (CanMantle())
|
|
||||||
// {
|
|
||||||
// MantleToLocation(_plannedMantleLocation.Unwrap());
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!WallHugSystem.IsWallHugging() || Velocity.Length() < _wallRunSpeedThreshold)
|
// Reorient horizontal velocity so we keep it coplanar with the wall without losing speed
|
||||||
|
var finalHVel = hvelProjected.Normalized() * hvel.Length();
|
||||||
|
|
||||||
|
// Adapt vertical speed
|
||||||
|
var verticalSpeed = Velocity.Y - WallRunAltitudeLossSpeed * delta;
|
||||||
|
Velocity = finalHVel + Vector3.Up*verticalSpeed;
|
||||||
|
Velocity *= 0.995f;
|
||||||
|
|
||||||
|
_currentWallContactPoint = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero);
|
||||||
|
|
||||||
|
if (isOnFloorCustom())
|
||||||
|
_playerState.SendEvent("grounded");
|
||||||
|
if (!WallHugSystem.IsWallHugging() || Velocity.Length() < WallRunSpeedThreshold)
|
||||||
{
|
{
|
||||||
_playerState.SendEvent("start_falling");
|
_playerState.SendEvent("start_falling");
|
||||||
}
|
}
|
||||||
@@ -541,15 +609,14 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
Velocity = Vector3.Zero;
|
Velocity = Vector3.Zero;
|
||||||
GlobalPosition = _wallHugStartLocation;
|
GlobalPosition = _wallHugStartLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Option<Vector3> _plannedMantleLocation = Option<Vector3>.None;
|
|
||||||
|
|
||||||
// Jump
|
// Jump
|
||||||
public void OnInputJumpStarted()
|
public void OnInputJumpStarted()
|
||||||
{
|
{
|
||||||
if (CanMantle())
|
_isJumpInputPressed = true;
|
||||||
|
if (MantleSystem.IsMantlePossible)
|
||||||
{
|
{
|
||||||
MantleToLocation(_plannedMantleLocation.Unwrap());
|
_playerState.SendEvent("mantle");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -558,6 +625,11 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_playerState.SendEvent("megajump");
|
_playerState.SendEvent("megajump");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_onWallHuggingCoyoteEnabled.Active || _onWallRunningCoyoteEnabled.Active)
|
||||||
|
{
|
||||||
|
if (!_isWallJumpAvailable) return;
|
||||||
|
}
|
||||||
_playerState.SendEvent("jump");
|
_playerState.SendEvent("jump");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,6 +639,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
|
|
||||||
public void OnInputJumpEnded()
|
public void OnInputJumpEnded()
|
||||||
{
|
{
|
||||||
|
_isJumpInputPressed = false;
|
||||||
_playerState.SendEvent("jump_ended");
|
_playerState.SendEvent("jump_ended");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,6 +655,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
public void OnDoubleJumpStarted()
|
public void OnDoubleJumpStarted()
|
||||||
{
|
{
|
||||||
_canDash = true;
|
_canDash = true;
|
||||||
|
_canDashAirborne = true;
|
||||||
OnJumpStarted(DoubleJumpStartVelocity);
|
OnJumpStarted(DoubleJumpStartVelocity);
|
||||||
}
|
}
|
||||||
public void OnMegaJumpStarted()
|
public void OnMegaJumpStarted()
|
||||||
@@ -603,8 +677,14 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
var currentHorizontalVelocity = new Vector2(Velocity.X, Velocity.Z);
|
var currentHorizontalVelocity = new Vector2(Velocity.X, Velocity.Z);
|
||||||
var wallJumpHorizontalVelocity = new Vector2(jumpVector.X, jumpVector.Z);
|
var wallJumpHorizontalVelocity = new Vector2(jumpVector.X, jumpVector.Z);
|
||||||
|
|
||||||
SetHorizontalVelocity(currentHorizontalVelocity + wallJumpHorizontalVelocity);;
|
SetHorizontalVelocity(currentHorizontalVelocity + wallJumpHorizontalVelocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnJumpFromWallCoyote()
|
||||||
|
{
|
||||||
|
_isWallJumpAvailable = false;
|
||||||
|
}
|
||||||
|
|
||||||
public void OnJumpFromWall()
|
public void OnJumpFromWall()
|
||||||
{
|
{
|
||||||
ComputeJumpFromWallHSpeed(WallJumpStartVelocity);
|
ComputeJumpFromWallHSpeed(WallJumpStartVelocity);
|
||||||
@@ -626,9 +706,14 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
return _inputMoveKeyboard;
|
return _inputMoveKeyboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector3 GetGlobalMoveInput()
|
||||||
|
{
|
||||||
|
return Transform.Basis * HeadSystem.Transform.Basis * GetMoveInput();
|
||||||
|
}
|
||||||
|
|
||||||
public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null)
|
public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null)
|
||||||
{
|
{
|
||||||
var dir = direction ?? Transform.Basis * HeadSystem.Transform.Basis * GetMoveInput();
|
var dir = direction ?? GetGlobalMoveInput();
|
||||||
|
|
||||||
var acceleration = dir.Length() > 0 ? accelerationFactor : decelerationFactor;
|
var acceleration = dir.Length() > 0 ? accelerationFactor : decelerationFactor;
|
||||||
|
|
||||||
@@ -660,8 +745,48 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
z: velocity.Y);
|
z: velocity.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Path _mantlePath;
|
||||||
|
public void OnMantleStarted()
|
||||||
|
{
|
||||||
|
HeadSystem.OnMantle();
|
||||||
|
|
||||||
|
_mantlePath = MantlePath.Instantiate() as Path;
|
||||||
|
if (_mantlePath == null)
|
||||||
|
{
|
||||||
|
GD.PrintErr("Failed to instantiate MantlePath");
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
GetTree().GetRoot().AddChild(_mantlePath);
|
||||||
|
_mantlePath.Setup(MantleSystem.GlobalTransform, MantleSystem.MantleCurve);
|
||||||
|
|
||||||
|
var tween = GetTree().CreateTween();
|
||||||
|
tween.SetTrans(Tween.TransitionType.Linear);
|
||||||
|
tween.SetEase(Tween.EaseType.InOut);
|
||||||
|
tween.TweenProperty(_mantlePath.PathFollow, "progress_ratio", 1, MantleTime);
|
||||||
|
tween.Finished += MantleFinished;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HandleMantling(float delta)
|
||||||
|
{
|
||||||
|
GlobalPosition = _mantlePath.Target.GlobalPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MantleFinished()
|
||||||
|
{
|
||||||
|
_mantlePath.Teardown();
|
||||||
|
var direction = GetInputGlobalHDirection();
|
||||||
|
if (direction.Length() > 0)
|
||||||
|
{
|
||||||
|
SetVelocity(direction * SimpleDashStrength);
|
||||||
|
}
|
||||||
|
_playerState.SendEvent("grounded");
|
||||||
|
}
|
||||||
|
|
||||||
public void HandleJump(float delta, float gravityFactor, int hangFrames)
|
public void HandleJump(float delta, float gravityFactor, int hangFrames)
|
||||||
{
|
{
|
||||||
|
if (IsTryingToMantle()) _playerState.SendEvent("mantle");
|
||||||
|
|
||||||
// Update horizontal velocity
|
// Update horizontal velocity
|
||||||
var horizontalVelocity = ComputeHVelocityAir(delta);
|
var horizontalVelocity = ComputeHVelocityAir(delta);
|
||||||
Velocity = new Vector3(horizontalVelocity.X, Velocity.Y, horizontalVelocity.Z);
|
Velocity = new Vector3(horizontalVelocity.X, Velocity.Y, horizontalVelocity.Z);
|
||||||
@@ -880,15 +1005,18 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
if (WeaponSystem.IsPlantedUnderPlatform())
|
if (WeaponSystem.IsPlantedUnderPlatform())
|
||||||
dashLocation += Vector3.Down * _playerHeight;
|
dashLocation += Vector3.Down * _playerHeight;
|
||||||
|
|
||||||
|
_wallHugStartNormal = WeaponSystem.PlantNormal;
|
||||||
|
_currentWallContactPoint = WeaponSystem.PlantLocation;
|
||||||
|
_wallHugStartLocation = dashLocation;
|
||||||
|
_wallHugStartProjectedVelocity = Velocity.Slide(_wallHugStartNormal);
|
||||||
|
|
||||||
var dashTween = CreatePositionTween(dashLocation, AimedDashTime);
|
var dashTween = CreatePositionTween(dashLocation, AimedDashTime);
|
||||||
dashTween.Finished += DashToPlantedWeaponTweenEnded;
|
dashTween.Finished += DashToPlantedWeaponTweenEnded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RecoverWeapon()
|
public void RecoverWeapon()
|
||||||
{
|
{
|
||||||
GetTree().GetRoot().RemoveChild(WeaponRoot);
|
RecoverChildNode(WeaponRoot);
|
||||||
AddChild(WeaponRoot);
|
|
||||||
WeaponRoot.SetGlobalPosition(GlobalPosition);
|
|
||||||
WeaponSystem.ResetWeapon();
|
WeaponSystem.ResetWeapon();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -901,7 +1029,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
|
|
||||||
RecoverWeapon();
|
RecoverWeapon();
|
||||||
|
|
||||||
var resultingEvent = shouldDashToHanging ? "to_planted" : "dash_finished";
|
var resultingEvent = shouldDashToHanging ? "dash_to_planted" : "dash_finished";
|
||||||
_playerState.SendEvent(resultingEvent);
|
_playerState.SendEvent(resultingEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -943,19 +1071,33 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
|
|
||||||
public void PlaceWeaponForTutorial()
|
public void PlaceWeaponForTutorial()
|
||||||
{
|
{
|
||||||
|
if (TutorialDone)
|
||||||
|
return;
|
||||||
|
|
||||||
RemoveChild(WeaponRoot);
|
RemoveChild(WeaponRoot);
|
||||||
GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, WeaponRoot);
|
GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, WeaponRoot);
|
||||||
WeaponRoot.CallDeferred(Node3D.MethodName.SetGlobalPosition, TutorialWeaponTarget.GlobalPosition);
|
WeaponRoot.CallDeferred(Node3D.MethodName.SetGlobalPosition, TutorialWeaponTarget.GlobalPosition);
|
||||||
WeaponSystem.CallDeferred(WeaponSystem.MethodName.PlaceWeaponForTutorial, TutorialWeaponTarget.GlobalPosition);
|
WeaponSystem.CallDeferred(WeaponSystem.MethodName.PlaceWeaponForTutorial, TutorialWeaponTarget.GlobalPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RemoveChildNode(Node3D node)
|
||||||
|
{
|
||||||
|
RemoveChild(node);
|
||||||
|
GetTree().GetRoot().AddChild(node);
|
||||||
|
node.SetGlobalPosition(GlobalPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RecoverChildNode(Node3D node)
|
||||||
|
{
|
||||||
|
GetTree().GetRoot().RemoveChild(node);
|
||||||
|
AddChild(node);
|
||||||
|
node.SetGlobalPosition(GlobalPosition);
|
||||||
|
}
|
||||||
|
|
||||||
public void ThrowWeapon()
|
public void ThrowWeapon()
|
||||||
{
|
{
|
||||||
_playerState.SendEvent("cancel_aim");
|
_playerState.SendEvent("cancel_aim");
|
||||||
|
RemoveChildNode(WeaponRoot);
|
||||||
RemoveChild(WeaponRoot);
|
|
||||||
GetTree().GetRoot().AddChild(WeaponRoot);
|
|
||||||
WeaponRoot.SetGlobalPosition(GlobalPosition);
|
|
||||||
|
|
||||||
var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.PlannedLocation;
|
var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.PlannedLocation;
|
||||||
WeaponSystem.ThrowWeapon(
|
WeaponSystem.ThrowWeapon(
|
||||||
@@ -969,9 +1111,13 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
{
|
{
|
||||||
var postDashVelocity = _preDashVelocity.Length() > PostDashSpeed ? PostDashSpeed : _preDashVelocity.Length();
|
var postDashVelocity = _preDashVelocity.Length() > PostDashSpeed ? PostDashSpeed : _preDashVelocity.Length();
|
||||||
Velocity = _dashDirection * postDashVelocity;
|
Velocity = _dashDirection * postDashVelocity;
|
||||||
|
|
||||||
if (_shouldMantleOnDashEnded)
|
if (_shouldMantleOnDashEnded)
|
||||||
MantleToLocation(_mantleLocation);
|
{
|
||||||
|
// TODO update post dash mantle
|
||||||
|
// MantleToLocation(_mantleLocation);
|
||||||
|
GD.Print("update post dash mantle");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSimpleDashStarted()
|
public void OnSimpleDashStarted()
|
||||||
@@ -1011,9 +1157,6 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
|
|
||||||
public void OnPoweredDashFinished()
|
public void OnPoweredDashFinished()
|
||||||
{
|
{
|
||||||
// Try mantling but don't know if this is useful
|
|
||||||
// if (CanMantle())
|
|
||||||
// MantleToLocation(MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y).Unwrap());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FinishPoweredDash()
|
public void FinishPoweredDash()
|
||||||
@@ -1051,36 +1194,17 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_playerState.SendEvent("coyote_expired");
|
_playerState.SendEvent("coyote_expired");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mantling
|
|
||||||
public bool CanMantle()
|
|
||||||
{
|
|
||||||
var mantleLocationResult = MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y);
|
|
||||||
return mantleLocationResult.IsSome(out _);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Vector3 _preMantleVelocity = Vector3.Zero;
|
|
||||||
public void MantleToLocation(Vector3 location)
|
|
||||||
{
|
|
||||||
HeadSystem.OnMantle();
|
|
||||||
|
|
||||||
_preMantleVelocity = Velocity;
|
|
||||||
var mantleTween = CreatePositionTween(location, MantleTime);
|
|
||||||
mantleTween.Finished += MantleFinished;
|
|
||||||
}
|
|
||||||
public void MantleFinished()
|
|
||||||
{
|
|
||||||
Velocity = _preMantleVelocity;
|
|
||||||
_playerState.SendEvent("grounded");
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
// Stateless logic ////////
|
// Stateless logic ////////
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
private void LookAround()
|
private void LookAround(double delta)
|
||||||
{
|
{
|
||||||
Vector2 inputLookDir = new Vector2(_inputRotateY, _inputRotateFloorplane);
|
Vector2 inputLookDir = new Vector2(_inputRotateY, _inputRotateFloorplane);
|
||||||
var lookSensitivity = _isUsingGamepad ? _lookSensitivityMultiplier : _mouseSensitivityMultiplier;
|
var lookSensitivity = _isUsingGamepad ? _lookSensitivityMultiplier : _mouseSensitivityMultiplier;
|
||||||
HeadSystem.LookAround(inputLookDir, lookSensitivity);
|
|
||||||
|
var wallHugContactPoint = _onWallRunning.Active || _onWallRunningCoyoteEnabled.Active ? _currentWallContactPoint : Vector3.Zero;
|
||||||
|
var playerVelocity = GetGlobalMoveInput();
|
||||||
|
HeadSystem.LookAround(delta, inputLookDir, playerVelocity, wallHugContactPoint, lookSensitivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveOnGround(double delta)
|
public void MoveOnGround(double delta)
|
||||||
@@ -1158,7 +1282,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
Bobbing.CameraBobbingParams cameraBobbingParams = new Bobbing.CameraBobbingParams
|
Bobbing.CameraBobbingParams cameraBobbingParams = new Bobbing.CameraBobbingParams
|
||||||
{
|
{
|
||||||
Delta = delta,
|
Delta = delta,
|
||||||
IsOnFloorCustom = isOnFloorCustom(),
|
IsOnFloorCustom = isOnFloorCustom() || _onWallRunning.Active || _onWallRunningCoyoteEnabled.Active,
|
||||||
Velocity = Velocity,
|
Velocity = Velocity,
|
||||||
SettingsMultiplier = _headBobbingMultiplier
|
SettingsMultiplier = _headBobbingMultiplier
|
||||||
};
|
};
|
||||||
@@ -1219,10 +1343,10 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
///////////////////////////
|
///////////////////////////
|
||||||
public override void _PhysicsProcess(double delta)
|
public override void _PhysicsProcess(double delta)
|
||||||
{
|
{
|
||||||
LookAround();
|
LookAround(delta);
|
||||||
CameraModifications((float) delta);
|
CameraModifications((float) delta);
|
||||||
HandleStairs((float) delta);
|
HandleStairs((float) delta);
|
||||||
_plannedMantleLocation = MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y);
|
MantleSystem.ProcessMantle(_grounded.Active);
|
||||||
|
|
||||||
if (WeaponSystem.InHandState.Active)
|
if (WeaponSystem.InHandState.Active)
|
||||||
RotateWeaponWithPlayer();
|
RotateWeaponWithPlayer();
|
||||||
|
|||||||
25
scenes/path/Path.cs
Normal file
25
scenes/path/Path.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Godot;
|
||||||
|
|
||||||
|
public partial class Path : Path3D
|
||||||
|
{
|
||||||
|
public PathFollow3D PathFollow { get; private set; }
|
||||||
|
public Marker3D Target { get; private set; }
|
||||||
|
|
||||||
|
public override void _Ready()
|
||||||
|
{
|
||||||
|
PathFollow = GetNode<PathFollow3D>("PathFollow");
|
||||||
|
Target = GetNode<Marker3D>("PathFollow/Target");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Setup(Transform3D globalTransform, Curve3D curve)
|
||||||
|
{
|
||||||
|
SetGlobalTransform(globalTransform);
|
||||||
|
SetCurve(curve);
|
||||||
|
PathFollow.ProgressRatio = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Teardown()
|
||||||
|
{
|
||||||
|
QueueFree();
|
||||||
|
}
|
||||||
|
}
|
||||||
1
scenes/path/Path.cs.uid
Normal file
1
scenes/path/Path.cs.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://djdr5bvfc8f0x
|
||||||
13
scenes/path/path.tscn
Normal file
13
scenes/path/path.tscn
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://cf3rrgr1imvv4"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://djdr5bvfc8f0x" path="res://scenes/path/Path.cs" id="1_kmlhi"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve3D" id="Curve3D_u4rfr"]
|
||||||
|
|
||||||
|
[node name="Path" type="Path3D"]
|
||||||
|
curve = SubResource("Curve3D_u4rfr")
|
||||||
|
script = ExtResource("1_kmlhi")
|
||||||
|
|
||||||
|
[node name="PathFollow" type="PathFollow3D" parent="."]
|
||||||
|
|
||||||
|
[node name="Target" type="Marker3D" parent="PathFollow"]
|
||||||
@@ -25,7 +25,6 @@ public partial class DashSystem: Node3D
|
|||||||
private ShapeCast3D _dashCast3D;
|
private ShapeCast3D _dashCast3D;
|
||||||
private ShapeCast3D _playerCast3D;
|
private ShapeCast3D _playerCast3D;
|
||||||
private Camera3D _camera;
|
private Camera3D _camera;
|
||||||
private TweenQueueSystem _tweenQueueSystem;
|
|
||||||
private Vector3 _dashDirection = Vector3.Zero;
|
private Vector3 _dashDirection = Vector3.Zero;
|
||||||
|
|
||||||
private ShapeCast3D _dashCastDrop;
|
private ShapeCast3D _dashCastDrop;
|
||||||
@@ -54,7 +53,7 @@ public partial class DashSystem: Node3D
|
|||||||
|
|
||||||
public float DashCastRadius { get; set; }
|
public float DashCastRadius { get; set; }
|
||||||
|
|
||||||
public void Init(Node3D head, Camera3D camera, TweenQueueSystem tweenQueueSystem)
|
public void Init(Node3D head, Camera3D camera)
|
||||||
{
|
{
|
||||||
_dashCast3D = GetNode<ShapeCast3D>("DashCast3D");
|
_dashCast3D = GetNode<ShapeCast3D>("DashCast3D");
|
||||||
var dashShape = _dashCast3D.GetShape() as SphereShape3D;
|
var dashShape = _dashCast3D.GetShape() as SphereShape3D;
|
||||||
@@ -73,7 +72,6 @@ public partial class DashSystem: Node3D
|
|||||||
|
|
||||||
_head = head;
|
_head = head;
|
||||||
_camera = camera;
|
_camera = camera;
|
||||||
_tweenQueueSystem = tweenQueueSystem;
|
|
||||||
|
|
||||||
_mantleSystem = GetNode<MantleSystem>("MantleSystem");
|
_mantleSystem = GetNode<MantleSystem>("MantleSystem");
|
||||||
_mantleSystem.Init();
|
_mantleSystem.Init();
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ debug_shape_custom_color = Color(0.863327, 0.636844, 0, 1)
|
|||||||
|
|
||||||
[node name="DashCast3D" type="ShapeCast3D" parent="."]
|
[node name="DashCast3D" type="ShapeCast3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
|
||||||
|
visible = false
|
||||||
shape = SubResource("SphereShape3D_jngg2")
|
shape = SubResource("SphereShape3D_jngg2")
|
||||||
target_position = Vector3(0, 0, -12)
|
target_position = Vector3(0, 0, -12)
|
||||||
max_results = 1
|
max_results = 1
|
||||||
@@ -41,6 +42,7 @@ debug_shape_custom_color = Color(0.911631, 0.11884, 0.656218, 1)
|
|||||||
|
|
||||||
[node name="DashCastDrop" type="ShapeCast3D" parent="."]
|
[node name="DashCastDrop" type="ShapeCast3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 1.6, 0)
|
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 1.6, 0)
|
||||||
|
visible = false
|
||||||
shape = SubResource("SphereShape3D_jngg2")
|
shape = SubResource("SphereShape3D_jngg2")
|
||||||
target_position = Vector3(0, 0, -50)
|
target_position = Vector3(0, 0, -50)
|
||||||
max_results = 1
|
max_results = 1
|
||||||
@@ -52,6 +54,7 @@ mesh = SubResource("SphereMesh_qu4wy")
|
|||||||
surface_material_override/0 = SubResource("StandardMaterial3D_v31n3")
|
surface_material_override/0 = SubResource("StandardMaterial3D_v31n3")
|
||||||
|
|
||||||
[node name="MantleSystem" parent="." instance=ExtResource("2_pff7b")]
|
[node name="MantleSystem" parent="." instance=ExtResource("2_pff7b")]
|
||||||
|
visible = false
|
||||||
MantleEndLocationDistanceFromWall = 0.25
|
MantleEndLocationDistanceFromWall = 0.25
|
||||||
MantleHeightCastStart = 2.0
|
MantleHeightCastStart = 2.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using RustyOptions;
|
||||||
|
|
||||||
namespace Movementtests.systems;
|
namespace Movementtests.systems;
|
||||||
|
|
||||||
@@ -11,6 +12,15 @@ public partial class HeadSystem : Node3D
|
|||||||
|
|
||||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||||
public float LookSensitivity { get; set; } = 1f;
|
public float LookSensitivity { get; set; } = 1f;
|
||||||
|
|
||||||
|
[Export(PropertyHint.Range, "0.1,50,0.1,or_greater")]
|
||||||
|
public double CameraInclineAcceleration { get; set; } = 10f;
|
||||||
|
|
||||||
|
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||||
|
public float WallRunCameraIncline { get; set; } = 5f;
|
||||||
|
|
||||||
|
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||||
|
public float GroundedCameraIncline { get; set; } = 5f;
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
@@ -25,7 +35,7 @@ public partial class HeadSystem : Node3D
|
|||||||
_animationPlayer.Play("mantle");
|
_animationPlayer.Play("mantle");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LookAround(Vector2 lookDir, float sensitivitMultiplier = 1f)
|
public void LookAround(double delta, Vector2 lookDir, Vector3 playerVelocity, Vector3? wallContactPoint = null, float sensitivitMultiplier = 1f)
|
||||||
{
|
{
|
||||||
// Horizontal movement of head
|
// Horizontal movement of head
|
||||||
float angleForHorizontalRotation = lookDir.X * LookSensitivity * sensitivitMultiplier;
|
float angleForHorizontalRotation = lookDir.X * LookSensitivity * sensitivitMultiplier;
|
||||||
@@ -35,11 +45,33 @@ public partial class HeadSystem : Node3D
|
|||||||
Vector3 currentCameraRotation = _cameraAnchor.Rotation;
|
Vector3 currentCameraRotation = _cameraAnchor.Rotation;
|
||||||
currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity * sensitivitMultiplier);
|
currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity * sensitivitMultiplier);
|
||||||
currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f));
|
currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f));
|
||||||
|
|
||||||
|
var isWallRunning = wallContactPoint.HasValue && wallContactPoint.Value.Length() > Mathf.Epsilon;
|
||||||
|
var cameraIncline = 0f;
|
||||||
|
if (isWallRunning)
|
||||||
|
{
|
||||||
|
var directionToWall = (wallContactPoint.Value - GlobalPosition).Normalized();
|
||||||
|
var cameraInclineFactor = ComputeCameraInclineFactor(directionToWall);
|
||||||
|
cameraIncline = Mathf.DegToRad(WallRunCameraIncline * cameraInclineFactor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var cameraInclineFactor = ComputeCameraInclineFactor(playerVelocity);
|
||||||
|
cameraIncline = Mathf.DegToRad(GroundedCameraIncline * cameraInclineFactor * -1.0f);
|
||||||
|
}
|
||||||
|
currentCameraRotation.Z = (float) Mathf.Lerp(currentCameraRotation.Z, cameraIncline, delta * CameraInclineAcceleration);
|
||||||
_cameraAnchor.Rotation = currentCameraRotation;
|
_cameraAnchor.Rotation = currentCameraRotation;
|
||||||
|
|
||||||
_camera.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated();
|
_camera.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float ComputeCameraInclineFactor(Vector3 direction)
|
||||||
|
{
|
||||||
|
var forward = GetForwardHorizontalVector().Normalized();
|
||||||
|
var crossProduct = forward.Cross(direction);
|
||||||
|
return crossProduct.Length()*Mathf.Sign(crossProduct.Y);
|
||||||
|
}
|
||||||
|
|
||||||
public Vector3 GetForwardHorizontalVector()
|
public Vector3 GetForwardHorizontalVector()
|
||||||
{
|
{
|
||||||
return GetGlobalTransform().Basis.Z;
|
return GetGlobalTransform().Basis.Z;
|
||||||
|
|||||||
@@ -14,25 +14,96 @@ public partial class MantleSystem: Node3D
|
|||||||
|
|
||||||
private ShapeCast3D _wallInFrontCast3D;
|
private ShapeCast3D _wallInFrontCast3D;
|
||||||
private ShapeCast3D _mantleCast3D;
|
private ShapeCast3D _mantleCast3D;
|
||||||
private RayCast3D _mantleCheckCast3D;
|
|
||||||
|
private ShapeCast3D _inAirWallDetect;
|
||||||
|
private ShapeCast3D _groundedWallDetect;
|
||||||
|
public Curve3D MantleCurve { get; private set; }
|
||||||
|
|
||||||
|
public bool IsMantlePossible { get; private set; } = false;
|
||||||
|
public const int WallProfileCastCount = 7;
|
||||||
|
|
||||||
|
private ShapeCast3D[] _wallProfileShapecasts = new ShapeCast3D[WallProfileCastCount];
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
_wallInFrontCast3D = GetNode<ShapeCast3D>("WallInFrontCast3D");
|
_wallInFrontCast3D = GetNode<ShapeCast3D>("WallInFrontCast3D");
|
||||||
_mantleCast3D = GetNode<ShapeCast3D>("MantleCast3D");
|
_mantleCast3D = GetNode<ShapeCast3D>("MantleCast3D");
|
||||||
|
|
||||||
|
_inAirWallDetect = GetNode<ShapeCast3D>("InAirWallDetect");
|
||||||
|
_groundedWallDetect = GetNode<ShapeCast3D>("GroundedWallDetect");
|
||||||
|
for (int i = 0; i < _wallProfileShapecasts.Length; i++)
|
||||||
|
{
|
||||||
|
_wallProfileShapecasts[i] = GetNode<ShapeCast3D>($"WallProfileShapeCasts/ShapeCast{i + 1}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Option<Vector3> FindMantleForHeadRotation(float rotation)
|
private void SetCastsEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
_wallInFrontCast3D.SetRotation(new Vector3(
|
foreach (var wallProfileShapecast in _wallProfileShapecasts)
|
||||||
_wallInFrontCast3D.Rotation.X,
|
{
|
||||||
rotation,
|
wallProfileShapecast.SetEnabled(enabled);
|
||||||
_wallInFrontCast3D.Rotation.Z));
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProcessMantle(bool isGrounded)
|
||||||
|
{
|
||||||
|
_inAirWallDetect.SetEnabled(!isGrounded);
|
||||||
|
_groundedWallDetect.SetEnabled(isGrounded);
|
||||||
|
var isColliding = _inAirWallDetect.IsColliding() || _groundedWallDetect.IsColliding();
|
||||||
|
SetCastsEnabled(isColliding);
|
||||||
|
|
||||||
|
// Reset state
|
||||||
|
IsMantlePossible = false;
|
||||||
|
if (!isColliding) return;
|
||||||
|
|
||||||
|
// Check if collide with wall
|
||||||
|
var collisionNormal = isGrounded ? _groundedWallDetect.GetCollisionNormal(0) : _inAirWallDetect.GetCollisionNormal(0);
|
||||||
|
if (collisionNormal.Y > 0.9f) return;
|
||||||
|
|
||||||
|
MantleCurve = new Curve3D();
|
||||||
|
MantleCurve.AddPoint(Vector3.Zero);
|
||||||
|
var hasFirstProfileHit = false;
|
||||||
|
foreach (var wallProfileShapecast in _wallProfileShapecasts)
|
||||||
|
{
|
||||||
|
// Haven't met the wall yet
|
||||||
|
if (!wallProfileShapecast.IsColliding() && !hasFirstProfileHit) continue;
|
||||||
|
|
||||||
|
var globalTargetPosition = wallProfileShapecast.GlobalPosition + wallProfileShapecast.TargetPosition;
|
||||||
|
|
||||||
|
// Got to the other side of the wall, we stop there
|
||||||
|
if (!wallProfileShapecast.IsColliding())
|
||||||
|
{
|
||||||
|
MantleCurve.AddPoint(ToLocal(globalTargetPosition));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var profilePoint = wallProfileShapecast.GetCollisionPoint(0);
|
||||||
|
var profileNormal = wallProfileShapecast.GetCollisionNormal(0);
|
||||||
|
|
||||||
|
// Check if we collided parallel to a wall
|
||||||
|
var isCollisionSameAsTarget = globalTargetPosition.IsEqualApprox(profilePoint);
|
||||||
|
var isCollidingWithWall = profileNormal.Y < 0.1f;
|
||||||
|
if (isCollisionSameAsTarget || isCollidingWithWall) continue;
|
||||||
|
|
||||||
|
// We have a valid collision
|
||||||
|
hasFirstProfileHit = true;
|
||||||
|
MantleCurve.AddPoint(ToLocal(profilePoint));
|
||||||
|
}
|
||||||
|
if (MantleCurve.PointCount == 1) return;
|
||||||
|
|
||||||
|
IsMantlePossible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Option<Vector3> FindMantle()
|
||||||
|
{
|
||||||
if (!_wallInFrontCast3D.IsColliding())
|
if (!_wallInFrontCast3D.IsColliding())
|
||||||
{
|
{
|
||||||
return Option<Vector3>.None;
|
return Option<Vector3>.None;
|
||||||
}
|
}
|
||||||
|
if (_wallInFrontCast3D.GetCollisionNormal(0).Y > 0.8f)
|
||||||
|
{
|
||||||
|
return Option<Vector3>.None;
|
||||||
|
}
|
||||||
|
|
||||||
var collisionPoint = _wallInFrontCast3D.GetCollisionPoint(0);
|
var collisionPoint = _wallInFrontCast3D.GetCollisionPoint(0);
|
||||||
var collisionNormal = _wallInFrontCast3D.GetCollisionNormal(0);
|
var collisionNormal = _wallInFrontCast3D.GetCollisionNormal(0);
|
||||||
|
|||||||
4
systems/mantle/find_wall_shape.tres
Normal file
4
systems/mantle/find_wall_shape.tres
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[gd_resource type="SphereShape3D" format=3 uid="uid://dp2p8v7demb5j"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
radius = 0.25
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=4 format=3 uid="uid://wq1okogkhc5l"]
|
[gd_scene load_steps=7 format=3 uid="uid://wq1okogkhc5l"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bja6tis1vaysu" path="res://systems/mantle/MantleSystem.cs" id="1_2oobp"]
|
[ext_resource type="Script" uid="uid://bja6tis1vaysu" path="res://systems/mantle/MantleSystem.cs" id="1_2oobp"]
|
||||||
|
|
||||||
@@ -8,12 +8,23 @@ height = 1.7
|
|||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_2oobp"]
|
[sub_resource type="SphereShape3D" id="SphereShape3D_2oobp"]
|
||||||
radius = 0.75
|
radius = 0.75
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_2oobp"]
|
||||||
|
radius = 0.25
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_i32qj"]
|
||||||
|
radius = 0.25
|
||||||
|
height = 1.5
|
||||||
|
|
||||||
|
[sub_resource type="SphereShape3D" id="SphereShape3D_i32qj"]
|
||||||
|
radius = 0.125
|
||||||
|
|
||||||
[node name="MantleSystem" type="Node3D"]
|
[node name="MantleSystem" type="Node3D"]
|
||||||
script = ExtResource("1_2oobp")
|
script = ExtResource("1_2oobp")
|
||||||
MantleEndLocationDistanceFromWall = 0.2
|
MantleEndLocationDistanceFromWall = 0.2
|
||||||
MantleHeightCastStart = 3.0
|
MantleHeightCastStart = 3.0
|
||||||
|
|
||||||
[node name="MantleCast3D" type="ShapeCast3D" parent="."]
|
[node name="MantleCast3D" type="ShapeCast3D" parent="."]
|
||||||
|
visible = false
|
||||||
shape = SubResource("CapsuleShape3D_4coqe")
|
shape = SubResource("CapsuleShape3D_4coqe")
|
||||||
target_position = Vector3(0, 0, 0)
|
target_position = Vector3(0, 0, 0)
|
||||||
max_results = 1
|
max_results = 1
|
||||||
@@ -22,8 +33,72 @@ debug_shape_custom_color = Color(1, 0, 0, 1)
|
|||||||
|
|
||||||
[node name="WallInFrontCast3D" type="ShapeCast3D" parent="."]
|
[node name="WallInFrontCast3D" type="ShapeCast3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
|
visible = false
|
||||||
shape = SubResource("SphereShape3D_2oobp")
|
shape = SubResource("SphereShape3D_2oobp")
|
||||||
target_position = Vector3(0, 0, -1.5)
|
target_position = Vector3(0, 0, -1.5)
|
||||||
max_results = 1
|
max_results = 1
|
||||||
collision_mask = 2
|
collision_mask = 2
|
||||||
debug_shape_custom_color = Color(0.911631, 0.11884, 0.656218, 1)
|
debug_shape_custom_color = Color(0.911631, 0.11884, 0.656218, 1)
|
||||||
|
|
||||||
|
[node name="InAirWallDetect" type="ShapeCast3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.01, 0)
|
||||||
|
shape = SubResource("CapsuleShape3D_2oobp")
|
||||||
|
target_position = Vector3(0, 0, -2)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="GroundedWallDetect" type="ShapeCast3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.26, 0)
|
||||||
|
shape = SubResource("CapsuleShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, 0, -2)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="WallProfileShapeCasts" type="Node3D" parent="."]
|
||||||
|
|
||||||
|
[node name="ShapeCast1" type="ShapeCast3D" parent="WallProfileShapeCasts"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -0.5)
|
||||||
|
enabled = false
|
||||||
|
shape = SubResource("SphereShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, -2.375, 0)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="ShapeCast2" type="ShapeCast3D" parent="WallProfileShapeCasts"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -0.75)
|
||||||
|
enabled = false
|
||||||
|
shape = SubResource("SphereShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, -2.375, 0)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="ShapeCast3" type="ShapeCast3D" parent="WallProfileShapeCasts"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1)
|
||||||
|
enabled = false
|
||||||
|
shape = SubResource("SphereShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, -2.375, 0)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="ShapeCast4" type="ShapeCast3D" parent="WallProfileShapeCasts"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1.25)
|
||||||
|
enabled = false
|
||||||
|
shape = SubResource("SphereShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, -2.375, 0)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="ShapeCast5" type="ShapeCast3D" parent="WallProfileShapeCasts"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1.5)
|
||||||
|
enabled = false
|
||||||
|
shape = SubResource("SphereShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, -2.375, 0)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="ShapeCast6" type="ShapeCast3D" parent="WallProfileShapeCasts"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -1.75)
|
||||||
|
enabled = false
|
||||||
|
shape = SubResource("SphereShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, -2.375, 0)
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="ShapeCast7" type="ShapeCast3D" parent="WallProfileShapeCasts"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -2)
|
||||||
|
enabled = false
|
||||||
|
shape = SubResource("SphereShape3D_i32qj")
|
||||||
|
target_position = Vector3(0, -2.375, 0)
|
||||||
|
collision_mask = 2
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ extends Node3D
|
|||||||
@export_tool_button("Tuto start", "Callable") var player_tuto_start = place_player_tuto_start
|
@export_tool_button("Tuto start", "Callable") var player_tuto_start = place_player_tuto_start
|
||||||
@export_tool_button("Playground", "Callable") var player_playground = place_player_playground
|
@export_tool_button("Playground", "Callable") var player_playground = place_player_playground
|
||||||
|
|
||||||
@onready var player: CharacterBody3D = $Player
|
|
||||||
|
|
||||||
|
@onready var player: CharacterBody3D = $Player
|
||||||
|
|
||||||
func place_player_tuto_start():
|
func place_player_tuto_start():
|
||||||
player.position = Vector3(0, -132.75, 118)
|
player.position = Vector3(0, -132.75, 118)
|
||||||
|
|||||||
Reference in New Issue
Block a user