1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-11-21 23:34:21 +00:00

Fix player OnHand viewport weirdness

This commit is contained in:
Steffo 2023-01-09 01:51:19 +01:00
parent 87afcff6fc
commit 990c7bcb17
Signed by: steffo
GPG key ID: 6965406171929D01
3 changed files with 33 additions and 108 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://b5i1sqd88wlle"] [gd_scene load_steps=14 format=3 uid="uid://b5i1sqd88wlle"]
[ext_resource type="Script" path="res://player/Player.gd" id="1_rujcr"] [ext_resource type="Script" path="res://player/Player.gd" id="1_rujcr"]
[ext_resource type="Script" path="res://player/Head.gd" id="2_ohlgu"] [ext_resource type="Script" path="res://player/Head.gd" id="2_ohlgu"]
@ -22,49 +22,6 @@ bg_color = Color(0.240234, 0.240234, 0.240234, 1)
[sub_resource type="Theme" id="Theme_smyke"] [sub_resource type="Theme" id="Theme_smyke"]
Panel/styles/panel = SubResource("StyleBoxFlat_vqko1") Panel/styles/panel = SubResource("StyleBoxFlat_vqko1")
[sub_resource type="GDScript" id="GDScript_iiadi"]
resource_name = "FPS_Counter"
script/source = "extends Label
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
self.text = str(round(1/delta)) + \" FPS\"
"
[sub_resource type="GDScript" id="GDScript_5d122"]
resource_name = "PointsSpawner"
script/source = "extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func spawn_points_label(text: String, offset: Vector2):
var label = Label.new()
label.text = text
label.offset_bottom = -offset.y
label.offset_left = offset.x
self.add_child(label)
var initialY = label.position.y
var tween = get_tree().create_tween()
tween.set_speed_scale(2)
tween.parallel().tween_property(label, \"position:y\", initialY - 50, 1).as_relative().from_current().set_trans(Tween.EASE_OUT)
tween.parallel().tween_property(label, \"modulate\", Color.TRANSPARENT, 1).set_trans(Tween.EASE_OUT)
tween.tween_callback(label.queue_free)
tween.play()
"
[sub_resource type="GDScript" id="GDScript_7qy62"] [sub_resource type="GDScript" id="GDScript_7qy62"]
script/source = "extends Camera3D script/source = "extends Camera3D
@ -160,61 +117,8 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme = SubResource("Theme_smyke") theme = SubResource("Theme_smyke")
[node name="FPS_Label" type="Label" parent="HUD"]
visible = false
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -97.0
offset_bottom = 32.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 20
text = "n/d FPS"
horizontal_alignment = 2
script = SubResource("GDScript_iiadi")
[node name="PointsSpawner" type="Control" parent="HUD"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
script = SubResource("GDScript_5d122")
[node name="AmmoLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -103.0
offset_top = -26.0
offset_right = -8.0
offset_bottom = -8.0
grow_horizontal = 0
grow_vertical = 0
theme = ExtResource("4_d7ru6")
theme_override_font_sizes/font_size = 16
text = "8888 seeds left"
horizontal_alignment = 2
vertical_alignment = 2
[node name="BackBufferCopy2" type="BackBufferCopy" parent="HUD"]
position = Vector2(727, 447)
scale = Vector2(7.61, 4.89)
copy_mode = 2
metadata/_edit_lock_ = true
[node name="SubViewportContainer" type="SubViewportContainer" parent="HUD"] [node name="SubViewportContainer" type="SubViewportContainer" parent="HUD"]
modulate = Color(1, 0.596078, 1, 1)
show_behind_parent = true show_behind_parent = true
z_index = 4096
z_as_relative = false
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -238,6 +142,31 @@ near = 0.001
script = SubResource("GDScript_7qy62") script = SubResource("GDScript_7qy62")
MainCamera = NodePath("../../../../Head/Viewport/CameraViewportContainer/GameViewport/Camera") MainCamera = NodePath("../../../../Head/Viewport/CameraViewportContainer/GameViewport/Camera")
[node name="BackBufferCopy" type="BackBufferCopy" parent="HUD"]
y_sort_enabled = true
position = Vector2(140, 79)
scale = Vector2(1.65, 1)
metadata/_edit_lock_ = true
[node name="AmmoLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -103.0
offset_top = -26.0
offset_right = -8.0
offset_bottom = -8.0
grow_horizontal = 0
grow_vertical = 0
theme = ExtResource("4_d7ru6")
theme_override_font_sizes/font_size = 16
text = "8888 seeds left"
horizontal_alignment = 2
vertical_alignment = 2
[node name="Crosshair" type="ColorRect" parent="HUD"] [node name="Crosshair" type="ColorRect" parent="HUD"]
material = SubResource("ShaderMaterial_2p6rt") material = SubResource("ShaderMaterial_2p6rt")
layout_mode = 1 layout_mode = 1
@ -248,11 +177,10 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="BackBufferCopy" type="BackBufferCopy" parent="HUD"] [node name="BackBufferCopy2" type="BackBufferCopy" parent="HUD"]
visible = false position = Vector2(727, 447)
y_sort_enabled = true scale = Vector2(7.61, 4.89)
position = Vector2(140, 79) copy_mode = 2
scale = Vector2(1.65, 1)
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="RigidDynamicBody3D" type="RigidBody3D" parent="."] [node name="RigidDynamicBody3D" type="RigidBody3D" parent="."]

View file

@ -13,10 +13,6 @@ target_position = Vector3(1000, 0, 0)
collision_mask = 24 collision_mask = 24
collide_with_areas = true collide_with_areas = true
[node name="peashooter2" parent="." instance=ExtResource("2_ra8vl")]
transform = Transform3D(-0.5, 0, -7.54979e-08, 0, 0.5, 0, 7.54979e-08, 0, -0.5, 0.6, -0.8, 0.5)
visible = false
[node name="ShootSound" type="AudioStreamPlayer" parent="."] [node name="ShootSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_uhlty") stream = ExtResource("4_uhlty")
max_polyphony = 10 max_polyphony = 10

View file

@ -21,7 +21,7 @@ func _process(delta: float) -> void:
pass pass
" "
[sub_resource type="Image" id="Image_x4j0v"] [sub_resource type="Image" id="Image_435th"]
data = { data = {
"data": PackedByteArray(158, 191, 83, 255, 74, 102, 67, 255, 33, 63, 46, 255, 23, 42, 46, 255, 43, 35, 53, 255, 42, 44, 86, 255, 61, 78, 112, 255, 110, 168, 180, 255, 181, 211, 215, 255, 116, 109, 119, 255, 59, 58, 60, 255, 50, 47, 52, 255, 0, 0, 0, 255, 42, 26, 35, 255, 78, 27, 29, 255, 127, 49, 64, 255, 174, 105, 107, 255, 244, 247, 171, 255, 228, 177, 125, 255, 187, 117, 57, 255, 146, 76, 52, 255, 93, 64, 50, 255, 84, 59, 53, 255, 71, 42, 42, 255, 55, 36, 36, 255, 85, 205, 252, 255, 255, 255, 255, 255, 247, 168, 184, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 0, 0, 0, 0), "data": PackedByteArray(158, 191, 83, 255, 74, 102, 67, 255, 33, 63, 46, 255, 23, 42, 46, 255, 43, 35, 53, 255, 42, 44, 86, 255, 61, 78, 112, 255, 110, 168, 180, 255, 181, 211, 215, 255, 116, 109, 119, 255, 59, 58, 60, 255, 50, 47, 52, 255, 0, 0, 0, 255, 42, 26, 35, 255, 78, 27, 29, 255, 127, 49, 64, 255, 174, 105, 107, 255, 244, 247, 171, 255, 228, 177, 125, 255, 187, 117, 57, 255, 146, 76, 52, 255, 93, 64, 50, 255, 84, 59, 53, 255, 71, 42, 42, 255, 55, 36, 36, 255, 85, 205, 252, 255, 255, 255, 255, 255, 247, 168, 184, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 75, 75, 75, 255, 0, 0, 0, 0),
"format": "RGBA8", "format": "RGBA8",
@ -31,7 +31,7 @@ data = {
} }
[sub_resource type="ImageTexture" id="ImageTexture_7gqgu"] [sub_resource type="ImageTexture" id="ImageTexture_7gqgu"]
image = SubResource("Image_x4j0v") image = SubResource("Image_435th")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_00xel"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_00xel"]
resource_local_to_scene = true resource_local_to_scene = true
@ -76,6 +76,7 @@ shadow_mesh = SubResource("ArrayMesh_ob77b")
script = SubResource("GDScript_mxvns") script = SubResource("GDScript_mxvns")
[node name="Untitled" parent="." index="0"] [node name="Untitled" parent="." index="0"]
layers = 2
mesh = SubResource("ArrayMesh_bmb2a") mesh = SubResource("ArrayMesh_bmb2a")
[node name="LightmapGI" type="LightmapGI" parent="." index="1"] [node name="LightmapGI" type="LightmapGI" parent="." index="1"]