mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-07-15 16:34:48 +00:00
Make the Flag entity smooth as silk
This commit is contained in:
parent
a18a9ea6f3
commit
323c5f1c99
7 changed files with 43 additions and 32 deletions
|
|
@ -49,10 +49,9 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
|
|||
@onready var animation_player : AnimationPlayer = $AnimationPlayer
|
||||
@onready var health_component : Area3D = $HealthComponent
|
||||
@onready var collision_shape : CollisionShape3D = $CollisionShape3D
|
||||
@onready var flag_carry_component : FlagCarryComponent = $FlagCarryComponent
|
||||
@onready var flag_carry_component : FlagCarryComponent = $Smoothing/SpringArm3D/FlagCarryComponent
|
||||
@onready var spring_arm_height : float = $Smoothing/SpringArm3D.position.y
|
||||
@onready var _original_weapon_transform : Transform3D = weapon.transform
|
||||
@onready var flag_carry_attachment : Node3D = $Smoothing/SpringArm3D/FlagCarryAttachment
|
||||
@onready var tp_player : Vanguard = $Smoothing/ThirdPerson/PlayerMesh
|
||||
@onready var _game_settings : Settings = get_node("/root/GlobalSettings")
|
||||
|
||||
|
|
@ -86,7 +85,6 @@ func _ready() -> void:
|
|||
camera.fov = _game_settings.fov
|
||||
# set the spring arm translation to be about head height level
|
||||
$Smoothing/SpringArm3D.transform = Transform3D().translated(Vector3(0, collision_shape.shape.height / 2, 0) * 0.9)
|
||||
flag_carry_attachment.hide()
|
||||
|
||||
$Smoothing.remove_child($Smoothing/ThirdPerson)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=18 format=3 uid="uid://cbhx1xme0sb7k"]
|
||||
[gd_scene load_steps=19 format=3 uid="uid://cbhx1xme0sb7k"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/player/player.gd" id="1_mk68k"]
|
||||
[ext_resource type="PackedScene" uid="uid://drbefw6akui2v" path="res://entities/player/assets/vanguard.tscn" id="2_beyex"]
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
[ext_resource type="Script" path="res://entities/player/player_input.gd" id="6_ymcrr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dsysi2rd3bu76" path="res://interfaces/hud/iffs/iff.tscn" id="7_8hc80"]
|
||||
[ext_resource type="PackedScene" uid="uid://2t8ql8pkxv6c" path="res://components/flag_carry_component.tscn" id="7_e7s1a"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3l7fvbdg6m5g" path="res://entities/flag/assets/flag.glb" id="9_fce2y"]
|
||||
[ext_resource type="Script" path="res://addons/smoothing/smoothing.gd" id="11_k330l"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_clur0"]
|
||||
|
|
@ -130,11 +131,6 @@ shape = ExtResource("2_vjqny")
|
|||
[node name="CollisionShape3D" type="CollisionShape3D" parent="HealthComponent"]
|
||||
shape = ExtResource("2_vjqny")
|
||||
|
||||
[node name="FlagCarryComponent" parent="." node_paths=PackedStringArray("attachment", "sensor", "carrier") instance=ExtResource("7_e7s1a")]
|
||||
attachment = NodePath("../Smoothing/SpringArm3D/FlagCarryAttachment")
|
||||
sensor = NodePath("../Sensor")
|
||||
carrier = NodePath("..")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_hg307")
|
||||
|
|
@ -174,8 +170,14 @@ holder = NodePath("../../../..")
|
|||
[node name="SpineIKTarget" type="Node3D" parent="Smoothing/SpringArm3D"]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
||||
|
||||
[node name="FlagCarryAttachment" type="Node3D" parent="Smoothing/SpringArm3D"]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, -0.620994, -0.287925)
|
||||
[node name="FlagCarryComponent" parent="Smoothing/SpringArm3D" node_paths=PackedStringArray("sensor", "carrier") instance=ExtResource("7_e7s1a")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0.150603)
|
||||
visible = false
|
||||
sensor = NodePath("../../../Sensor")
|
||||
carrier = NodePath("../../..")
|
||||
|
||||
[node name="FlagMesh" parent="Smoothing/SpringArm3D/FlagCarryComponent" instance=ExtResource("9_fce2y")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.602515, 0)
|
||||
|
||||
[node name="ThirdPerson" type="Node3D" parent="Smoothing"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue