diff --git a/TODO_LIST b/TODO_LIST index 56fdf3b..3294133 100644 --- a/TODO_LIST +++ b/TODO_LIST @@ -1,4 +1,8 @@ Current plans: + ^ Add world model + ^ Separate Viewmodel + ^ Hide view from players and world from player + Rework player states Player teams Team spawns Bomb diff --git a/scenes/player.tscn b/scenes/player.tscn index 9067470..a3668dd 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=3 uid="uid://dpsr6ug3pkb40"] +[gd_scene load_steps=17 format=3 uid="uid://dpsr6ug3pkb40"] [ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scripts/player/player.gd" id="1_g2els"] [ext_resource type="Script" uid="uid://dalwlndejfdhm" path="res://scripts/player/crosshair.gd" id="3_dqkch"] @@ -6,7 +6,9 @@ [ext_resource type="PackedScene" uid="uid://c3hg4ux4j76j2" path="res://models/molikman_hands.glb" id="4_dqkch"] [ext_resource type="Script" uid="uid://6c14qse4vnra" path="res://scripts/player/player_raycast.gd" id="4_fjrip"] [ext_resource type="Script" uid="uid://bmecgup3kcua7" path="res://scripts/weapon_system/weapon_system.gd" id="4_qlg0r"] +[ext_resource type="Script" uid="uid://dd5mp72dq43v6" path="res://scripts/multiplayer/own_visibility_toggle.gd" id="4_smehm"] [ext_resource type="PackedScene" uid="uid://djwjl8xll53vn" path="res://scenes/weapons/starting_pistol.tscn" id="7_fjrip"] +[ext_resource type="PackedScene" uid="uid://c2r8dbudbs7l3" path="res://models/molikman_ingame.glb" id="8_smehm"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_u8vuu"] @@ -125,6 +127,13 @@ animation_player = NodePath("AnimationPlayer") stand_up_area = NodePath("StandArea") CROUCH_TIME = 0.1 +[node name="molikman_ingame" parent="." instance=ExtResource("8_smehm")] +transform = Transform3D(0.75, 0, 0, 0, 0.75, 0, 0, 0, 0.75, 0, 1.1793717, 0) + +[node name="VisibleEnabler" type="Node" parent="molikman_ingame"] +script = ExtResource("4_smehm") +visible_for_others = true + [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) shape = SubResource("CapsuleShape3D_u8vuu") @@ -140,6 +149,9 @@ compensation_delay = 0.2 [node name="molikman_hands" parent="Camera3D" instance=ExtResource("4_dqkch")] transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, -1, 0) +[node name="VisibleDisabler" type="Node" parent="Camera3D/molikman_hands"] +script = ExtResource("4_smehm") + [node name="Skeleton3D" parent="Camera3D/molikman_hands/Hands" index="0"] bones/1/position = Vector3(0.16239367, 0.7620353, -0.22555673) bones/1/rotation = Quaternion(-0.013897974, 0.25458142, 0.93291974, 0.25427514) diff --git a/scripts/multiplayer/own_visibility_toggle.gd b/scripts/multiplayer/own_visibility_toggle.gd new file mode 100644 index 0000000..e721e0a --- /dev/null +++ b/scripts/multiplayer/own_visibility_toggle.gd @@ -0,0 +1,6 @@ +extends Node + +@export var visible_for_others: bool = false + +func _ready() -> void: + get_parent().visible = (get_multiplayer_authority() != multiplayer.get_unique_id()) == visible_for_others diff --git a/scripts/multiplayer/own_visibility_toggle.gd.uid b/scripts/multiplayer/own_visibility_toggle.gd.uid new file mode 100644 index 0000000..706f3dc --- /dev/null +++ b/scripts/multiplayer/own_visibility_toggle.gd.uid @@ -0,0 +1 @@ +uid://dd5mp72dq43v6