basic movement tutorial

This commit is contained in:
2026-02-05 08:30:35 +01:00
parent 55a12ec7cd
commit f589ef8dec
4 changed files with 228 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
[gd_scene format=3 uid="uid://87l65i0f2fqi"]
[ext_resource type="PackedScene" uid="uid://dblmypced1fvv" path="res://assets/meshes/stairs/stairs.fbx" id="1_s50te"]
[ext_resource type="Script" uid="uid://do8vihuwc4iib" path="res://tools/generate_collisions.gd" id="2_xm10s"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_s50te"]
data = PackedVector3Array(0.5, 0, -0.5, -0.5, 0.25, -0.5, -0.5, 0, -0.5, -0.5, 0.25, -0.5, 0.5, 0, -0.5, -0.25, 0.25, -0.5, -0.25, 0.25, -0.5, 0.5, 0, -0.5, 0, 0.5, -0.5, -0.25, 0.25, -0.5, 0, 0.5, -0.5, -0.25, 0.5, -0.5, 0, 0.5, -0.5, 0.5, 0, -0.5, 0.5, 1, -0.5, 0, 0.5, -0.5, 0.5, 1, -0.5, 0.25, 0.75, -0.5, 0.25, 0.75, -0.5, 0.5, 1, -0.5, 0.25, 1, -0.5, 0, 0.5, -0.5, 0.25, 0.75, -0.5, 0, 0.75, -0.5, -0.5, 0.25, -0.5, -0.5, 0, 0.5, -0.5, 0, -0.5, -0.5, 0, 0.5, -0.5, 0.25, -0.5, -0.5, 0.25, 0.5, 0.5, 0, -0.5, -0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, -0.5, 0, -0.5, 0.5, 0, -0.5, 0.5, 1, 0.5, 0.5, 1, -0.5, 0.5, 1, 0.5, 0.5, 0, -0.5, 0.5, 0, 0.5, 0.5, 1, 0.5, 0.25, 1, -0.5, 0.5, 1, -0.5, 0.25, 1, -0.5, 0.5, 1, 0.5, 0.25, 1, 0.5, 0.5, 1, 0.5, 0.25, 0.75, 0.5, 0.25, 1, 0.5, 0.5, 1, 0.5, 0, 0.5, 0.5, 0.25, 0.75, 0.5, 0, 0.5, 0.5, 0, 0.75, 0.5, 0.25, 0.75, 0.5, 0.5, 0, 0.5, 0, 0.5, 0.5, 0.5, 1, 0.5, 0, 0.5, 0.5, 0.5, 0, 0.5, -0.5, 0, 0.5, 0, 0.5, 0.5, -0.5, 0, 0.5, -0.25, 0.25, 0.5, -0.5, 0, 0.5, -0.5, 0.25, 0.5, -0.25, 0.25, 0.5, -0.25, 0.25, 0.5, -0.25, 0.5, 0.5, 0, 0.5, 0.5, -0.25, 0.25, 0.5, -0.5, 0.25, -0.5, -0.25, 0.25, -0.5, -0.5, 0.25, -0.5, -0.25, 0.25, 0.5, -0.5, 0.25, 0.5, -0.25, 0.5, -0.5, -0.25, 0.25, 0.5, -0.25, 0.25, -0.5, -0.25, 0.25, 0.5, -0.25, 0.5, -0.5, -0.25, 0.5, 0.5, 0, 0.5, 0.5, -0.25, 0.5, -0.5, 0, 0.5, -0.5, -0.25, 0.5, -0.5, 0, 0.5, 0.5, -0.25, 0.5, 0.5, 0, 0.75, -0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, 0.75, -0.5, 0, 0.75, 0.5, 0.25, 0.75, 0.5, 0, 0.75, -0.5, 0.25, 0.75, -0.5, 0, 0.75, -0.5, 0.25, 0.75, 0.5, 0, 0.75, 0.5, 0.25, 1, -0.5, 0.25, 0.75, 0.5, 0.25, 0.75, -0.5, 0.25, 0.75, 0.5, 0.25, 1, -0.5, 0.25, 1, 0.5)
[node name="stairs" unique_id=1895117406 instance=ExtResource("1_s50te")]
script = ExtResource("2_xm10s")
collision_layer = 256
collision_mask = 65553
[node name="stairs_col2" type="StaticBody3D" parent="stairs" parent_id_path=PackedInt32Array(2145904663) index="0" unique_id=1786594295]
collision_layer = 256
collision_mask = 65553
[node name="CollisionShape3D" type="CollisionShape3D" parent="stairs/stairs_col2" index="0" unique_id=883090790]
shape = SubResource("ConcavePolygonShape3D_s50te")

View File

@@ -2,6 +2,9 @@
[ext_resource type="PackedScene" uid="uid://55wehh6xombr" path="res://maps/_templates/main_scene_template.tscn" id="1_jyq54"]
[ext_resource type="Material" uid="uid://31aulub2nqov" path="res://assets/materials/greybox/m_greybox.tres" id="2_lpm4c"]
[ext_resource type="Material" uid="uid://dw6lc8evmyc4d" path="res://assets/materials/greybox/m_greybox_valid.tres" id="3_u8sr4"]
[ext_resource type="Material" uid="uid://bm5f7jraqm8n0" path="res://assets/materials/greybox/m_greybox_secondary.tres" id="5_r26ni"]
[ext_resource type="PackedScene" uid="uid://87l65i0f2fqi" path="res://assets/meshes/stairs/stairs.tscn" id="5_u8sr4"]
[node name="Main" unique_id=955321579 instance=ExtResource("1_jyq54")]
@@ -15,3 +18,207 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.096, -0.5, -46.329)
use_collision = true
size = Vector3(100, 1, 190.741)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D2" type="CSGBox3D" parent="Greybox" index="1" unique_id=663820033]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.09600067, 3.25, 3.3005066)
use_collision = true
size = Vector3(10, 6.5, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D5" type="CSGBox3D" parent="Greybox" index="2" unique_id=1332226948]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.0960007, 3.25, -16.699493)
use_collision = true
size = Vector3(16, 6.5, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D6" type="CSGBox3D" parent="Greybox" index="3" unique_id=868182610]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.096001, 3.25, -8.699493)
use_collision = true
size = Vector3(16, 6.5, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D9" type="CSGBox3D" parent="Greybox" index="4" unique_id=1175427795]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7.75, -42)
use_collision = true
size = Vector3(38, 15.5, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D10" type="CSGBox3D" parent="Greybox" index="5" unique_id=427936811]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, 8.5, -35)
use_collision = true
size = Vector3(21.5, 17, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D3" type="CSGBox3D" parent="Greybox" index="6" unique_id=1254886602]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 3.903999, 3.25, -6.6994934)
use_collision = true
size = Vector3(18, 6.5, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D7" type="CSGBox3D" parent="Greybox" index="7" unique_id=133005848]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -18.096, 3.25, -25.449493)
use_collision = true
size = Vector3(31.5, 6.5, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D8" type="CSGBox3D" parent="Greybox" index="8" unique_id=1267333699]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -10.096001, 3.25, -26.699493)
use_collision = true
size = Vector3(18, 6.5, 2)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D4" type="CSGBox3D" parent="Greybox" index="9" unique_id=1453945590]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.0960007, 3.25, -2.6994934)
use_collision = true
size = Vector3(10, 6.5, 2)
material = ExtResource("2_lpm4c")
[node name="Step" type="CSGCombiner3D" parent="Greybox" index="10" unique_id=1645604967]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14, 0, -24)
[node name="CSGBox3D15" type="CSGBox3D" parent="Greybox/Step" index="0" unique_id=454828529]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.5, 2)
use_collision = true
size = Vector3(7.5, 1, 1)
material = ExtResource("3_u8sr4")
[node name="CSGBox3D16" type="CSGBox3D" parent="Greybox/Step" index="1" unique_id=834933161]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.5, 0)
use_collision = true
size = Vector3(7.5, 1, 3)
material = ExtResource("2_lpm4c")
[node name="Step2" type="CSGCombiner3D" parent="Greybox" index="11" unique_id=2118921085]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14, 1, -28)
[node name="CSGBox3D15" type="CSGBox3D" parent="Greybox/Step2" index="0" unique_id=1027706554]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.5, 2)
use_collision = true
size = Vector3(7.5, 1, 1)
material = ExtResource("3_u8sr4")
[node name="CSGBox3D16" type="CSGBox3D" parent="Greybox/Step2" index="1" unique_id=1973797616]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.5, 0)
use_collision = true
size = Vector3(7.5, 1, 3)
material = ExtResource("2_lpm4c")
[node name="Step3" type="CSGCombiner3D" parent="Greybox" index="12" unique_id=961820805]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -2, 2, -38.5)
[node name="CSGBox3D15" type="CSGBox3D" parent="Greybox/Step3" index="0" unique_id=1976117203]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.5, 2)
use_collision = true
size = Vector3(7.5, 1, 1)
material = ExtResource("3_u8sr4")
[node name="CSGBox3D16" type="CSGBox3D" parent="Greybox/Step3" index="1" unique_id=11066063]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, -0.75, -0.25)
use_collision = true
size = Vector3(7.5, 3.5, 3.5)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D17" type="CSGBox3D" parent="Greybox/Step3" index="2" unique_id=967072095]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, -1.75, 0.75)
use_collision = true
size = Vector3(7.5, 3.5, 3.5)
material = ExtResource("2_lpm4c")
[node name="Step4" type="CSGCombiner3D" parent="Greybox" index="13" unique_id=1579908989]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 2.5, 6, -38.5)
[node name="CSGBox3D15" type="CSGBox3D" parent="Greybox/Step4" index="0" unique_id=2059150172]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.5, 2)
use_collision = true
size = Vector3(7.5, 1, 1)
material = ExtResource("3_u8sr4")
[node name="CSGBox3D16" type="CSGBox3D" parent="Greybox/Step4" index="1" unique_id=1079232092]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, -0.75, -0.25)
use_collision = true
size = Vector3(7.5, 3.5, 3.5)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D17" type="CSGBox3D" parent="Greybox/Step4" index="2" unique_id=33075564]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, -4, 0.75)
use_collision = true
size = Vector3(7.5, 8, 3.5)
material = ExtResource("2_lpm4c")
[node name="stairs" parent="Greybox" index="14" unique_id=1895117406 instance=ExtResource("5_u8sr4")]
transform = Transform3D(-0.99999964, 0, -4.371139e-07, 0, 1, 0, 8.742275e-08, 0, -5, -8.5, 0, -38.5)
[node name="stairs2" parent="Greybox" index="15" unique_id=663901885 instance=ExtResource("5_u8sr4")]
transform = Transform3D(-0.99999964, 0, -4.371139e-07, 0, 1, 0, 8.742275e-08, 0, -5, -9.5, 1, -38.5)
[node name="CSGBox3D17" type="CSGBox3D" parent="Greybox" index="16" unique_id=1079419289]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.75, 0.75, -35.25)
use_collision = true
size = Vector3(7.5, 2.5, 11.5)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D11" type="CSGBox3D" parent="Greybox" index="17" unique_id=316945013]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.75, 6.5, -35.25)
use_collision = true
size = Vector3(10.5, 1, 13.5)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D12" type="CSGBox3D" parent="Greybox" index="18" unique_id=1227474775]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.5, 10.25, -37.75)
use_collision = true
size = Vector3(2, 13.5, 7.5)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D13" type="CSGBox3D" parent="Greybox" index="19" unique_id=1383851577]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.5, 8, -31.5)
use_collision = true
size = Vector3(2, 16, 5)
material = ExtResource("5_r26ni")
[node name="CSGBox3D15" type="CSGBox3D" parent="Greybox" index="20" unique_id=238418660]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.5, 8, -31.5)
use_collision = true
size = Vector3(2, 16, 5)
material = ExtResource("5_r26ni")
[node name="CSGBox3D14" type="CSGBox3D" parent="Greybox" index="21" unique_id=437211444]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, 8, -27)
use_collision = true
size = Vector3(7, 16, 4)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D20" type="CSGBox3D" parent="Greybox" index="22" unique_id=1913472587]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, 16.5, -26.5)
use_collision = true
size = Vector3(5, 1, 3)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D21" type="CSGBox3D" parent="Greybox" index="23" unique_id=2094633204]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9, 16.5, -29.5)
use_collision = true
size = Vector3(1, 1, 9)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D22" type="CSGBox3D" parent="Greybox" index="24" unique_id=1623594342]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 15, 16.5, -29.5)
use_collision = true
size = Vector3(1, 1, 9)
material = ExtResource("2_lpm4c")
[node name="CSGBox3D16" type="CSGBox3D" parent="Greybox" index="25" unique_id=1660129006]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, 16.5, -28.5)
use_collision = true
size = Vector3(5, 1, 1)
material = ExtResource("3_u8sr4")
[node name="CSGBox3D18" type="CSGBox3D" parent="Greybox" index="26" unique_id=528606233]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 16.5, -31.5)
use_collision = true
size = Vector3(1, 1, 5)
material = ExtResource("3_u8sr4")
[node name="CSGBox3D19" type="CSGBox3D" parent="Greybox" index="27" unique_id=533984919]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 16.5, -31.5)
use_collision = true
size = Vector3(1, 1, 5)
material = ExtResource("3_u8sr4")

1
stairs.gd Normal file
View File

@@ -0,0 +1 @@
extends "res://tools/generate_collisions.gd"

1
stairs.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://nnccp057g34w