Files
godot-demo-projects/3d/platformer/player/player.tscn
Hugo Locurcio 819d201cc4 Enable physics interpolation in all 3D demos (#1074)
This makes use of the new built-in 3D physics interpolation
added in Godot 4.4.
2025-04-15 16:54:41 +02:00

301 lines
12 KiB
Plaintext

[gd_scene load_steps=28 format=3 uid="uid://cc4idhykjp5f5"]
[ext_resource type="Script" uid="uid://juqqcu31phas" path="res://player/player.gd" id="1"]
[ext_resource type="Script" uid="uid://c34yhkkhix7m7" path="res://player/follow_camera.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://yd1e7ai2k5cr" path="res://player/player.glb" id="3_uccbe"]
[ext_resource type="Texture2D" uid="uid://kujhqacj3v72" path="res://player/controls/osb_up.webp" id="4_lmv6w"]
[ext_resource type="Texture2D" uid="uid://68sox6egj4j7" path="res://player/controls/osb_down.webp" id="5_4oxdy"]
[ext_resource type="Texture2D" uid="uid://r6qxvqi0unib" path="res://player/controls/osb_left.webp" id="6_k2dm4"]
[ext_resource type="AudioStream" uid="uid://cdx3i7hr2acow" path="res://player/sound_shoot.wav" id="7"]
[ext_resource type="Texture2D" uid="uid://bw76q621n8fie" path="res://player/controls/osb_right.webp" id="7_yth2f"]
[ext_resource type="AudioStream" uid="uid://bplqk77bffdxr" path="res://player/sound_jump.wav" id="8"]
[sub_resource type="CapsuleShape3D" id="1"]
radius = 0.4
height = 2.1
[sub_resource type="AnimationNodeAnimation" id="13"]
animation = &"run"
[sub_resource type="AnimationNodeAnimation" id="14"]
animation = &"jump"
[sub_resource type="AnimationNodeAnimation" id="15"]
animation = &"falling"
[sub_resource type="AnimationNodeAnimation" id="16"]
animation = &"shooting_standing"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_jij26"]
animation = &"walk"
[sub_resource type="AnimationNodeAnimation" id="17"]
animation = &"idle"
[sub_resource type="AnimationNodeBlend2" id="18"]
[sub_resource type="AnimationNodeBlend2" id="19"]
filter_enabled = true
filters = ["Skeleton/Skeleton3D:MASTER", "Skeleton/Skeleton3D:chest", "Skeleton/Skeleton3D:head", "Skeleton/Skeleton3D:headtracker", "Skeleton/Skeleton3D:hip", "Skeleton/Skeleton3D:l-arm", "Skeleton/Skeleton3D:l-forearm", "Skeleton/Skeleton3D:r-arm", "Skeleton/Skeleton3D:r-forearm", "Skeleton/Skeleton3D:vent", "Skeleton/Skeleton3D:waist"]
[sub_resource type="AnimationNodeBlend2" id="22"]
[sub_resource type="AnimationNodeTimeScale" id="20"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_lxtyk"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_bivc5"]
[sub_resource type="AnimationNodeBlendTree" id="23"]
graph_offset = Vector2(-221.364, -194.029)
nodes/Animation/node = SubResource("17")
nodes/Animation/position = Vector2(-260, -400)
"nodes/Animation 2/node" = SubResource("13")
"nodes/Animation 2/position" = Vector2(-260, -160)
"nodes/Animation 3/node" = SubResource("14")
"nodes/Animation 3/position" = Vector2(-260, -40)
"nodes/Animation 4/node" = SubResource("15")
"nodes/Animation 4/position" = Vector2(-260, 80)
"nodes/Animation 5/node" = SubResource("16")
"nodes/Animation 5/position" = Vector2(-260, 200)
"nodes/Animation 6/node" = SubResource("AnimationNodeAnimation_jij26")
"nodes/Animation 6/position" = Vector2(-260, -280)
nodes/air_dir/node = SubResource("18")
nodes/air_dir/position = Vector2(110, 20)
nodes/gun/node = SubResource("19")
nodes/gun/position = Vector2(680, 140)
nodes/output/position = Vector2(880, 140)
nodes/run/node = SubResource("22")
nodes/run/position = Vector2(80, -260)
nodes/scale/node = SubResource("20")
nodes/scale/position = Vector2(260, -120)
nodes/speed/node = SubResource("AnimationNodeBlend2_lxtyk")
nodes/speed/position = Vector2(-80, -200)
nodes/state/node = SubResource("AnimationNodeBlend2_bivc5")
nodes/state/position = Vector2(460, 10)
node_connections = [&"air_dir", 0, &"Animation 3", &"air_dir", 1, &"Animation 4", &"gun", 0, &"state", &"gun", 1, &"Animation 5", &"output", 0, &"gun", &"run", 0, &"Animation", &"run", 1, &"speed", &"scale", 0, &"run", &"speed", 0, &"Animation 6", &"speed", 1, &"Animation 2", &"state", 0, &"scale", &"state", 1, &"air_dir"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_basvh"]
random_pitch = 1.03
streams_count = 1
stream_0/stream = ExtResource("7")
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_axa7i"]
random_pitch = 1.03
streams_count = 1
stream_0/stream = ExtResource("8")
[sub_resource type="Gradient" id="Gradient_p2tu5"]
interpolation_mode = 2
offsets = PackedFloat32Array(0.2, 1)
colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_kvc1x"]
gradient = SubResource("Gradient_p2tu5")
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(0.5, 0.01)
[node name="Player" type="CharacterBody3D"]
script = ExtResource("1")
[node name="CollisionCapsule" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05, 0)
shape = SubResource("1")
[node name="Target" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.95244, 0)
[node name="Camera3D" type="Camera3D" parent="Target"]
transform = Transform3D(1, 0, 0, 0, 0.871263, 0.490817, 0, -0.490817, 0.871263, 0, 2.59805, 1.25672)
current = true
fov = 74.0
near = 0.1
script = ExtResource("2")
[node name="Player" parent="." instance=ExtResource("3_uccbe")]
[node name="Skeleton3D" parent="Player/Skeleton" index="0"]
bones/1/position = Vector3(1.09056e-20, 2.10612, -6.88338e-14)
bones/1/rotation = Quaternion(1.42109e-13, -2.84217e-14, -7.28307e-22, 1)
bones/2/rotation = Quaternion(-1.42109e-13, -1.80682e-21, 4.58668e-21, 1)
bones/3/rotation = Quaternion(-0.020416, 1.27213e-08, -1.7937e-09, 0.999792)
bones/4/rotation = Quaternion(3.37177e-09, 0.996325, -0.08565, -9.39008e-07)
bones/5/rotation = Quaternion(0.501129, -0.498869, -0.501129, 0.498869)
bones/6/position = Vector3(-6.01139e-07, 0.0040059, -2.27374e-13)
bones/7/position = Vector3(3.05648e-08, 1.2429, 0.270992)
bones/8/rotation = Quaternion(0.744208, 0.433567, -0.504614, 0.0594899)
bones/9/rotation = Quaternion(-0.264667, 0.951702, -0.155029, -0.0134332)
bones/10/rotation = Quaternion(0.744208, -0.433567, 0.504614, 0.0594898)
bones/11/rotation = Quaternion(0.264667, 0.951702, -0.155029, 0.0134332)
bones/11/scale = Vector3(1, 1, 1)
bones/12/rotation = Quaternion(0.998503, 0.0419892, -0.0282026, 0.0208368)
bones/13/position = Vector3(4.87277e-08, 0.644635, -6.03109e-10)
bones/13/rotation = Quaternion(-0.000357039, 0.998602, 0.0504818, -0.0156871)
bones/14/rotation = Quaternion(0.720784, -0.0117192, -0.0419344, 0.691791)
bones/15/rotation = Quaternion(0.998503, -0.0419892, 0.0282027, 0.0208378)
bones/16/position = Vector3(-6.38546e-08, 0.644636, -8.27896e-10)
bones/16/rotation = Quaternion(0.000356988, 0.998602, 0.0504828, 0.015687)
bones/17/rotation = Quaternion(0.720784, 0.0117191, 0.0419345, 0.691791)
bones/18/position = Vector3(-4.35527e-07, 6.35228, 5.79659)
bones/18/rotation = Quaternion(1, -1.01905e-13, 7.54979e-08, -4.23517e-21)
bones/19/position = Vector3(0.518863, 0.204768, 3.89848e-08)
bones/20/position = Vector3(-0.518863, 0.204768, -3.89848e-08)
bones/21/position = Vector3(0.411677, 1.62881, 0.663951)
bones/22/position = Vector3(-0.411677, 1.62881, 0.66395)
bones/23/position = Vector3(2.62535, 2.59016, 0.186879)
bones/25/position = Vector3(1.57185, 3.44768, -0.510255)
[node name="Robot" parent="Player/Skeleton/Skeleton3D" index="0"]
layers = 2
[node name="Bullet" type="Marker3D" parent="Player/Skeleton" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.94071, 3.6408, 3.3802)
[node name="CoinCount" type="Label3D" parent="Player/Skeleton" index="2"]
unique_name_in_owner = true
transform = Transform3D(-3.33333, 0, -2.91409e-07, 0, 3.33333, 0, 2.91409e-07, 0, -3.33333, 0, 7.51037, 0.531589)
double_sided = false
no_depth_test = true
modulate = Color(1, 0.8, 0.4, 1)
text = "123"
font_size = 48
[node name="Parallax" type="Label3D" parent="Player/Skeleton/CoinCount"]
transform = Transform3D(1, 0, 7.10543e-15, 0, 1, 0, -7.10543e-15, 0, 1, 0, 0, -0.01)
double_sided = false
no_depth_test = true
modulate = Color(0.8, 0.64, 0.32, 1)
text = "123"
font_size = 48
[node name="Parallax2" type="Label3D" parent="Player/Skeleton/CoinCount"]
transform = Transform3D(1, 0, 7.10543e-15, 0, 1, 0, -7.10543e-15, 0, 1, 0, 0, -0.02)
double_sided = false
no_depth_test = true
modulate = Color(0.6, 0.48, 0.24, 1)
text = "123"
font_size = 48
[node name="Parallax3" type="Label3D" parent="Player/Skeleton/CoinCount"]
transform = Transform3D(1, 0, 7.10543e-15, 0, 1, 0, -7.10543e-15, 0, 1, 0, 0, -0.03)
double_sided = false
no_depth_test = true
modulate = Color(0.4, 0.318667, 0.156, 1)
text = "123"
font_size = 48
[node name="Parallax4" type="Label3D" parent="Player/Skeleton/CoinCount"]
transform = Transform3D(1, 0, 7.10543e-15, 0, 1, 0, -7.10543e-15, 0, 1, 0, 0, -0.04)
double_sided = false
no_depth_test = true
modulate = Color(0.2, 0.159333, 0.078, 1)
text = "123"
font_size = 48
[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath("../Player")
tree_root = SubResource("23")
anim_player = NodePath("../Player/AnimationPlayer")
parameters/current_length = 1.23333
parameters/current_position = 0.395526
parameters/current_delta = 0.030673
parameters/Animation/current_length = 1.23333
parameters/Animation/current_position = 0.395526
parameters/Animation/current_delta = 0.030673
"parameters/Animation 2/current_length" = 0.833333
"parameters/Animation 2/current_position" = 0.0
"parameters/Animation 2/current_delta" = 0.0
"parameters/Animation 3/current_length" = 0.433333
"parameters/Animation 3/current_position" = 0.0
"parameters/Animation 3/current_delta" = 0.0
"parameters/Animation 4/current_length" = 0.433333
"parameters/Animation 4/current_position" = 0.0
"parameters/Animation 4/current_delta" = 0.0
"parameters/Animation 5/current_length" = 0.433333
"parameters/Animation 5/current_position" = 0.0
"parameters/Animation 5/current_delta" = 0.0
"parameters/Animation 6/current_length" = 1.03333
"parameters/Animation 6/current_position" = 0.0
"parameters/Animation 6/current_delta" = 0.0
parameters/air_dir/current_length = 0.433333
parameters/air_dir/current_position = 0.0
parameters/air_dir/current_delta = 0.0
parameters/air_dir/blend_amount = 0.0
parameters/gun/current_length = 1.23333
parameters/gun/current_position = 0.395526
parameters/gun/current_delta = 0.030673
parameters/gun/blend_amount = 0.0
parameters/output/current_length = 1.23333
parameters/output/current_position = 0.395526
parameters/output/current_delta = 0.030673
parameters/run/current_length = 1.23333
parameters/run/current_position = 0.395526
parameters/run/current_delta = 0.030673
parameters/run/blend_amount = 0.0
parameters/scale/current_length = 1.23333
parameters/scale/current_position = 0.395526
parameters/scale/current_delta = 0.030673
parameters/scale/scale = 1.5
parameters/speed/current_length = 1.03333
parameters/speed/current_position = 0.0
parameters/speed/current_delta = 0.0
parameters/speed/blend_amount = 0
parameters/state/current_length = 1.23333
parameters/state/current_position = 0.395526
parameters/state/current_delta = 0.030673
parameters/state/blend_amount = 0.0
[node name="Forward" type="TouchScreenButton" parent="."]
visible = false
position = Vector2(72, 301)
texture_normal = ExtResource("4_lmv6w")
texture_pressed = ExtResource("4_lmv6w")
passby_press = true
action = "move_forward"
visibility_mode = 1
[node name="Backward" type="TouchScreenButton" parent="."]
visible = false
position = Vector2(72, 365)
texture_normal = ExtResource("5_4oxdy")
texture_pressed = ExtResource("5_4oxdy")
passby_press = true
action = "move_backwards"
visibility_mode = 1
[node name="Left" type="TouchScreenButton" parent="."]
visible = false
position = Vector2(29, 332)
texture_normal = ExtResource("6_k2dm4")
texture_pressed = ExtResource("6_k2dm4")
passby_press = true
action = "move_left"
visibility_mode = 1
[node name="Right" type="TouchScreenButton" parent="."]
visible = false
position = Vector2(114, 332)
texture_normal = ExtResource("7_yth2f")
texture_pressed = ExtResource("7_yth2f")
passby_press = true
action = "move_right"
visibility_mode = 1
[node name="SoundShoot" type="AudioStreamPlayer" parent="."]
stream = SubResource("AudioStreamRandomizer_basvh")
[node name="SoundJump" type="AudioStreamPlayer" parent="."]
stream = SubResource("AudioStreamRandomizer_axa7i")
volume_db = -6.0
[node name="BlobShadow" type="Decal" parent="."]
size = Vector3(1.6, 12, 1.6)
texture_albedo = SubResource("GradientTexture2D_kvc1x")
albedo_mix = 0.8
upper_fade = 3.99999
lower_fade = 1.0
cull_mask = 1048573
[editable path="Player"]