[gd_scene load_steps=11 format=3 uid="uid://dae1bs2yqqt5l"]

[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_jsq3s"]
[ext_resource type="Environment" uid="uid://c1i78mwq3ug2f" path="res://Scenes/Enivornment.tres" id="2_t03qe"]
[ext_resource type="AudioStream" uid="uid://cupjwk5q538g2" path="res://Audio/SFX/gunshot.mp3" id="3_5mglu"]
[ext_resource type="Script" path="res://Scripts/SoundEffects.cs" id="4_fmvkw"]
[ext_resource type="PackedScene" uid="uid://cc5emorildoar" path="res://Scenes/Gun.tscn" id="5_sb1dv"]
[ext_resource type="Script" path="res://Scripts/Gun.cs" id="6_48ohb"]
[ext_resource type="Script" path="res://Scripts/PlayerHUD.cs" id="6_pawgr"]

[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cxbex"]

[sub_resource type="CapsuleMesh" id="CapsuleMesh_7dxig"]

[sub_resource type="LabelSettings" id="LabelSettings_3d4s1"]
font_size = 40
font_color = Color(0.490196, 0.403922, 0.278431, 1)
outline_size = 3
outline_color = Color(0, 0, 0, 1)

[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("_pivot")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.13331, 0)
collision_layer = 5
script = ExtResource("1_jsq3s")
_mouseSensitivity = 0.07
_pivot = NodePath("Pivot")

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_cxbex")

[node name="Pivot" type="Node3D" parent="."]

[node name="Camera3D" type="Camera3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.47186, 0.0718701)
environment = ExtResource("2_t03qe")
fov = 60.0

[node name="AimCast" type="RayCast3D" parent="Pivot/Camera3D"]
transform = Transform3D(0.125, 0, 0, 0, 0.125, 0, 0, 0, 0.125, 0, 0, 0)
target_position = Vector3(0, 0, -1000)

[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Pivot/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.10748, -0.0718701)
stream = ExtResource("3_5mglu")
volume_db = -13.823
max_db = -5.0
max_polyphony = 8
script = ExtResource("4_fmvkw")

[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
mesh = SubResource("CapsuleMesh_7dxig")

[node name="Gun" parent="." node_paths=PackedStringArray("_aimCast") instance=ExtResource("5_sb1dv")]
script = ExtResource("6_48ohb")
MaxAmmo = 30
DamagePerHit = 8.0
_aimCast = NodePath("../Pivot/Camera3D/AimCast")

[node name="CanvasLayer" type="CanvasLayer" parent="."]
script = ExtResource("6_pawgr")

[node name="AmmoLabel" type="Label" parent="CanvasLayer"]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -149.0
offset_top = -63.0
grow_horizontal = 0
grow_vertical = 0
size_flags_horizontal = 8
size_flags_vertical = 8
text = "Ammo"
label_settings = SubResource("LabelSettings_3d4s1")
horizontal_alignment = 1
vertical_alignment = 1

[connection signal="FireGun" from="Gun" to="Pivot/Camera3D/AudioStreamPlayer3D" method="OnFireGun"]
[connection signal="FireGun" from="Gun" to="CanvasLayer" method="UpdateCurrentAmmo"]
[connection signal="ReloadGun" from="Gun" to="CanvasLayer" method="UpdateCurrentAmmo"]
