diff options
author | nokoe <nokoe@mailbox.org> | 2024-06-21 13:43:07 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:27:04 +0200 |
commit | a263ff8817fad636266d66f47b2b7898c9a3a35b (patch) | |
tree | cc35f39c4069bd11de8795e08ceb7c06acb7d4a3 /client/scenes | |
parent | 1c9ddc8b8753696062bc999a5e5cf8620e518b11 (diff) | |
download | hurrycurry-a263ff8817fad636266d66f47b2b7898c9a3a35b.tar hurrycurry-a263ff8817fad636266d66f47b2b7898c9a3a35b.tar.bz2 hurrycurry-a263ff8817fad636266d66f47b2b7898c9a3a35b.tar.zst |
add camera
Diffstat (limited to 'client/scenes')
-rw-r--r-- | client/scenes/follow_camera.tscn | 7 | ||||
-rw-r--r-- | client/scenes/game.tscn | 12 |
2 files changed, 14 insertions, 5 deletions
diff --git a/client/scenes/follow_camera.tscn b/client/scenes/follow_camera.tscn new file mode 100644 index 00000000..816563ba --- /dev/null +++ b/client/scenes/follow_camera.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=3 uid="uid://b31mlnao6ybt8"] + +[ext_resource type="Script" path="res://scripts/follow_camera.gd" id="1_qipju"] + +[node name="FollowCamera" type="Camera3D"] +fov = 45.0 +script = ExtResource("1_qipju") diff --git a/client/scenes/game.tscn b/client/scenes/game.tscn index 7448d395..bf93d4d7 100644 --- a/client/scenes/game.tscn +++ b/client/scenes/game.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=6 format=3 uid="uid://clsylbmw7jc0s"] +[gd_scene load_steps=7 format=3 uid="uid://clsylbmw7jc0s"] [ext_resource type="PackedScene" uid="uid://bnqujofthaa4h" path="res://scenes/map.tscn" id="1_qt88a"] [ext_resource type="PackedScene" uid="uid://d30bj2cp1m7gd" path="res://scenes/player.tscn" id="2_cdwnc"] +[ext_resource type="PackedScene" uid="uid://b31mlnao6ybt8" path="res://scenes/follow_camera.tscn" id="3_6ot70"] [sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_ko0bu"] @@ -19,9 +20,6 @@ glow_enabled = true [node name="Game" type="Node3D"] -[node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 0.897643, 0.440723, 0, -0.440723, 0.897643, 0, 5.44153, 10.1162) - [node name="Map" parent="." instance=ExtResource("1_qt88a")] [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] @@ -31,6 +29,10 @@ shadow_enabled = true [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_h880f") -[node name="Player" parent="." node_paths=PackedStringArray("map") instance=ExtResource("2_cdwnc")] +[node name="Player" parent="." node_paths=PackedStringArray("map", "camera") instance=ExtResource("2_cdwnc")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 2) map = NodePath("../Map") +camera = NodePath("../FollowCamera") + +[node name="FollowCamera" parent="." node_paths=PackedStringArray("target") instance=ExtResource("3_6ot70")] +target = NodePath("../Player") |