save changes
This commit is contained in:
parent
cef87a7e2f
commit
c0099995e6
Binary file not shown.
@ -13,6 +13,7 @@ height = 1.5
|
|||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_qlkab"]
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_qlkab"]
|
||||||
radius = 0.35
|
radius = 0.35
|
||||||
|
height = 2.25001
|
||||||
|
|
||||||
[sub_resource type="SphereMesh" id="SphereMesh_vu2l8"]
|
[sub_resource type="SphereMesh" id="SphereMesh_vu2l8"]
|
||||||
radius = 0.35
|
radius = 0.35
|
||||||
@ -24,7 +25,7 @@ shader = ExtResource("3_rakxt")
|
|||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0n7pd"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0n7pd"]
|
||||||
shader = ExtResource("3_rakxt")
|
shader = ExtResource("3_rakxt")
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "neck", "player_avatar_face", "body", "head", "player_hud")]
|
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "neck", "player_avatar_face", "body", "head", "player_hud", "flashlight")]
|
||||||
collision_mask = 242
|
collision_mask = 242
|
||||||
script = ExtResource("1_bv7t4")
|
script = ExtResource("1_bv7t4")
|
||||||
camera = NodePath("Neck/Camera3D")
|
camera = NodePath("Neck/Camera3D")
|
||||||
@ -33,6 +34,7 @@ player_avatar_face = NodePath("Neck/Camera3D/PlayerAvatarFace")
|
|||||||
body = NodePath("Body")
|
body = NodePath("Body")
|
||||||
head = NodePath("Neck/Head")
|
head = NodePath("Neck/Head")
|
||||||
player_hud = NodePath("PlayerHUD")
|
player_hud = NodePath("PlayerHUD")
|
||||||
|
flashlight = NodePath("Neck/Camera3D/Flashlight")
|
||||||
|
|
||||||
[node name="PlayerTag" type="Label3D" parent="."]
|
[node name="PlayerTag" type="Label3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.26654, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.26654, 0)
|
||||||
@ -46,6 +48,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
|
|||||||
mesh = SubResource("CapsuleMesh_v7b3h")
|
mesh = SubResource("CapsuleMesh_v7b3h")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.125501, 0)
|
||||||
shape = SubResource("CapsuleShape3D_qlkab")
|
shape = SubResource("CapsuleShape3D_qlkab")
|
||||||
|
|
||||||
[node name="Neck" type="Node3D" parent="."]
|
[node name="Neck" type="Node3D" parent="."]
|
||||||
@ -66,6 +69,9 @@ shaded = true
|
|||||||
double_sided = false
|
double_sided = false
|
||||||
texture = ExtResource("2_omgn1")
|
texture = ExtResource("2_omgn1")
|
||||||
|
|
||||||
|
[node name="Flashlight" type="SpotLight3D" parent="Neck/Camera3D"]
|
||||||
|
spot_range = 9.0
|
||||||
|
|
||||||
[node name="Head" type="MeshInstance3D" parent="Neck"]
|
[node name="Head" type="MeshInstance3D" parent="Neck"]
|
||||||
mesh = SubResource("SphereMesh_vu2l8")
|
mesh = SubResource("SphereMesh_vu2l8")
|
||||||
|
|
||||||
|
@ -11,35 +11,32 @@ var steam_id: int = 0
|
|||||||
@export_category("Player")
|
@export_category("Player")
|
||||||
@export_range(1, 35, 1) var speed: float = 5.0
|
@export_range(1, 35, 1) var speed: float = 5.0
|
||||||
@export_range(10, 400, 1) var acceleration: float = 100.0
|
@export_range(10, 400, 1) var acceleration: float = 100.0
|
||||||
|
|
||||||
@export_range(0.1, 3.0, 0.1) var jump_height: float = 1.0
|
@export_range(0.1, 3.0, 0.1) var jump_height: float = 1.0
|
||||||
@export_range(0.1, 3.0, 0.1, "or_greater") var camera_sens: float = 1.0
|
@export_range(0.1, 3.0, 0.1, "or_greater") var camera_sens: float = 1.0
|
||||||
@export_range(0.1, 3.0, 0.1, "or_greater") var joystick_camera_sens_multiplier: float = 5.0
|
@export_range(0.1, 3.0, 0.1, "or_greater") var joystick_camera_sens_multiplier: float = 5.0
|
||||||
|
@export_category("Node References")
|
||||||
@export var camera: Camera3D
|
@export var camera: Camera3D
|
||||||
@export var neck: Node3D
|
@export var neck: Node3D
|
||||||
@export var player_avatar_face: Sprite3D
|
@export var player_avatar_face: Sprite3D
|
||||||
@export var body: MeshInstance3D
|
@export var body: MeshInstance3D
|
||||||
@export var head: MeshInstance3D
|
@export var head: MeshInstance3D
|
||||||
@export var player_hud: CanvasLayer
|
@export var player_hud: CanvasLayer
|
||||||
|
@export var flashlight: SpotLight3D
|
||||||
|
|
||||||
var jumping: bool = false
|
var jumping: bool = false
|
||||||
var is_using_joystick: bool = false
|
var is_using_joystick: bool = false
|
||||||
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||||
|
|
||||||
var move_dir: Vector2 # Input direction for movement
|
var move_dir: Vector2 # Input direction for movement
|
||||||
var look_dir: Vector2 # Input direction for look/aim
|
var look_dir: Vector2 # Input direction for look/aim
|
||||||
var walk_vel: Vector3 # Walking velocity
|
var walk_vel: Vector3 # Walking velocity
|
||||||
var grav_vel: Vector3 # Gravity velocity
|
var grav_vel: Vector3 # Gravity velocity
|
||||||
var jump_vel: Vector3 # Jumping velocity
|
var jump_vel: Vector3 # Jumping velocity
|
||||||
|
|
||||||
var current_ship: Ship
|
var current_ship: Ship
|
||||||
|
|
||||||
var previous_global_position: Vector3
|
var previous_global_position: Vector3
|
||||||
var previous_global_rotation: Vector3
|
var previous_global_rotation: Vector3
|
||||||
var previous_head_vert_rotation: Vector3
|
var previous_head_vert_rotation: Vector3
|
||||||
|
|
||||||
var neck_rotation_sync: Vector3
|
var neck_rotation_sync: Vector3
|
||||||
|
var light_state: bool
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@ -78,6 +75,9 @@ func _input(event):
|
|||||||
if Input.is_action_just_pressed("jump") and !is_piloting:
|
if Input.is_action_just_pressed("jump") and !is_piloting:
|
||||||
jumping = true
|
jumping = true
|
||||||
|
|
||||||
|
if Input.is_action_just_released("toggle_flashlight"):
|
||||||
|
handle_flashlight(event)
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if !is_network_authority: return
|
if !is_network_authority: return
|
||||||
@ -163,6 +163,17 @@ func _jump(delta: float) -> Vector3:
|
|||||||
return jump_vel
|
return jump_vel
|
||||||
|
|
||||||
|
|
||||||
|
func handle_flashlight(event):
|
||||||
|
if !flashlight.visible:
|
||||||
|
flashlight.show()
|
||||||
|
light_state = true
|
||||||
|
NetworkManager.sync_property_to_all(network_uuid, "light_state", light_state)
|
||||||
|
elif flashlight.visible:
|
||||||
|
flashlight.hide()
|
||||||
|
light_state = false
|
||||||
|
NetworkManager.sync_property_to_all(network_uuid, "light_state", light_state)
|
||||||
|
|
||||||
|
|
||||||
func player_entered_ship(ship_global_position: Vector3, ship: Ship):
|
func player_entered_ship(ship_global_position: Vector3, ship: Ship):
|
||||||
if !is_network_authority: return
|
if !is_network_authority: return
|
||||||
current_ship = ship
|
current_ship = ship
|
||||||
|
@ -121,8 +121,8 @@ func send_network_update():
|
|||||||
|
|
||||||
elif !NetworkManager.is_host and ship_is_piloted and piloting_player.steam_id == NetworkManager.steam_id:
|
elif !NetworkManager.is_host and ship_is_piloted and piloting_player.steam_id == NetworkManager.steam_id:
|
||||||
# Client is piloting, send updates to the host
|
# Client is piloting, send updates to the host
|
||||||
NetworkManager.sync_property_to_all_except_host(network_uuid, "global_position", predicted_position)
|
NetworkManager.sync_property_to_all(network_uuid, "global_position", predicted_position)
|
||||||
NetworkManager.sync_property_to_all_except_host(network_uuid, "global_rotation", predicted_rotation)
|
NetworkManager.sync_property_to_all(network_uuid, "global_rotation", predicted_rotation)
|
||||||
|
|
||||||
func receive_global_position_update(value: Vector3):
|
func receive_global_position_update(value: Vector3):
|
||||||
target_position = value
|
target_position = value
|
||||||
|
BIN
godot-jolt/windows/~godot-jolt_windows-x64_editor.dll
Normal file
BIN
godot-jolt/windows/~godot-jolt_windows-x64_editor.dll
Normal file
Binary file not shown.
@ -135,6 +135,12 @@ interact={
|
|||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
toggle_flashlight={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":true,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[layer_names]
|
[layer_names]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user