mirror of
https://github.com/thegatesbrowser/godot-multiplayer.git
synced 2025-10-16 02:03:43 -04:00
Update to 4.4.1
This commit is contained in:
parent
4ae45deca1
commit
ceb10e9a06
160 changed files with 491 additions and 71 deletions
1
player/audio_listener.gd.uid
Normal file
1
player/audio_listener.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://o63ivg4s4l5o
|
1
player/camera.gd.uid
Normal file
1
player/camera.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://c54m6p83hnjyl
|
|
@ -1,7 +1,7 @@
|
|||
class_name CameraController
|
||||
extends Node3D
|
||||
|
||||
@export_node_path var player_path : NodePath
|
||||
@export_node_path var player_path: NodePath
|
||||
@export var invert_mouse_y := false
|
||||
@export_range(0.0, 1.0) var mouse_sensitivity := 0.25
|
||||
@export_range(0.0, 8.0) var joystick_sensitivity := 2.0
|
||||
|
@ -29,8 +29,32 @@ func _ready() -> void:
|
|||
func _unhandled_input(event: InputEvent) -> void:
|
||||
_mouse_input = event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED
|
||||
if _mouse_input:
|
||||
_rotation_input = -event.relative.x * mouse_sensitivity
|
||||
_tilt_input = -event.relative.y * mouse_sensitivity
|
||||
_rotation_input = - event.relative.x * mouse_sensitivity
|
||||
_tilt_input = - event.relative.y * mouse_sensitivity
|
||||
|
||||
|
||||
func setup(anchor: CharacterBody3D) -> void:
|
||||
_anchor = anchor
|
||||
|
||||
# FIX: Don't preserve the initial offset - position the camera controller directly on the player
|
||||
# The old offset calculation was preserving incorrect initial positioning
|
||||
_offset = Vector3.ZERO # Remove any initial offset
|
||||
|
||||
# Position the camera controller directly on the player
|
||||
global_position = anchor.global_position
|
||||
|
||||
# CRITICAL FIX: Exclude the anchor from SpringArm3D collision detection
|
||||
# This prevents the camera from colliding with the character itself
|
||||
_camera_spring_arm.add_excluded_object(_anchor.get_rid())
|
||||
|
||||
# Also exclude the anchor's collision shape if it has one
|
||||
if _anchor.has_method("get_rid"):
|
||||
_camera_spring_arm.add_excluded_object(_anchor.get_rid())
|
||||
|
||||
# Additional fix: exclude all collision shapes from the character
|
||||
for child in _anchor.get_children():
|
||||
if child is CollisionShape3D:
|
||||
_camera_spring_arm.add_excluded_object(child.get_rid())
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
@ -46,8 +70,9 @@ func _physics_process(delta: float) -> void:
|
|||
if invert_mouse_y:
|
||||
_tilt_input *= -1
|
||||
|
||||
# Set camera controller to current ground level for the character
|
||||
var target_position := _anchor.global_position + _offset
|
||||
# FIX: Position camera controller directly on player, not with offset
|
||||
# Set camera controller to follow the player's position
|
||||
var target_position := _anchor.global_position
|
||||
target_position.y = lerp(global_position.y, _anchor._ground_height, 0.1)
|
||||
global_position = target_position
|
||||
|
||||
|
@ -58,15 +83,9 @@ func _physics_process(delta: float) -> void:
|
|||
|
||||
transform.basis = Basis.from_euler(_euler_rotation)
|
||||
|
||||
# Ensure the camera follows the spring arm pivot properly
|
||||
camera.global_transform = _pivot.global_transform
|
||||
camera.rotation.z = 0
|
||||
|
||||
_rotation_input = 0.0
|
||||
_tilt_input = 0.0
|
||||
|
||||
|
||||
func setup(anchor: CharacterBody3D) -> void:
|
||||
_anchor = anchor
|
||||
_offset = global_transform.origin - anchor.global_transform.origin
|
||||
camera.global_transform = camera.global_transform.interpolate_with(_pivot.global_transform, 0.1)
|
||||
_camera_spring_arm.add_excluded_object(_anchor.get_rid())
|
||||
|
|
1
player/camera_controller.gd.uid
Normal file
1
player/camera_controller.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dwxcjtn7c1ei4
|
1
player/model/character_skin.gd.uid
Normal file
1
player/model/character_skin.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dajdn0jgdwgkh
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=20 format=3 uid="uid://c0mo8tek77du4"]
|
||||
|
||||
[ext_resource type="Script" path="res://player/model/character_skin.gd" id="2_cp6td"]
|
||||
[ext_resource type="Script" uid="uid://dajdn0jgdwgkh" path="res://player/model/character_skin.gd" id="2_cp6td"]
|
||||
[ext_resource type="PackedScene" uid="uid://db7wkegkjmixy" path="res://player/model/gdbot.glb" id="2_v8h3f"]
|
||||
[ext_resource type="Material" uid="uid://dh42cdejchkr3" path="res://player/model/materials/face_mat.tres" id="3_fvn82"]
|
||||
[ext_resource type="AnimationNodeBlendTree" uid="uid://ctycm6blx4sw4" path="res://player/model/character_blend_tree.tres" id="3_hscum"]
|
||||
|
@ -2595,19 +2595,19 @@ tracks/51/keys = {
|
|||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_c1lpt"]
|
||||
_data = {
|
||||
"Idle": SubResource("Animation_kkfn2"),
|
||||
"fall": SubResource("Animation_euk6e"),
|
||||
"ground_impact": SubResource("Animation_1u2px"),
|
||||
"jump": SubResource("Animation_83u3k"),
|
||||
"run": SubResource("Animation_8540a"),
|
||||
"simple_punch": SubResource("Animation_73jd5"),
|
||||
"walk": SubResource("Animation_mcme0")
|
||||
&"Idle": SubResource("Animation_kkfn2"),
|
||||
&"fall": SubResource("Animation_euk6e"),
|
||||
&"ground_impact": SubResource("Animation_1u2px"),
|
||||
&"jump": SubResource("Animation_83u3k"),
|
||||
&"run": SubResource("Animation_8540a"),
|
||||
&"simple_punch": SubResource("Animation_73jd5"),
|
||||
&"walk": SubResource("Animation_mcme0")
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_8q8s6"]
|
||||
_data = {
|
||||
"default_heartbeat": ExtResource("3_xjurk"),
|
||||
"simple_blink": ExtResource("4_5i6m7")
|
||||
&"default_heartbeat": ExtResource("3_xjurk"),
|
||||
&"simple_blink": ExtResource("4_5i6m7")
|
||||
}
|
||||
|
||||
[node name="CharacterSkin" type="Node3D" node_paths=PackedStringArray("main_animation_player")]
|
||||
|
|
|
@ -17,6 +17,8 @@ nodes/root_type="Node3D"
|
|||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
|
@ -28,6 +30,7 @@ animation/import=true
|
|||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"animations": {
|
||||
|
|
1
player/model/materials/face_mat.gdshader.uid
Normal file
1
player/model/materials/face_mat.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://cn2hf5o4glv8b
|
|
@ -1,15 +1,15 @@
|
|||
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://dh42cdejchkr3"]
|
||||
|
||||
[ext_resource type="Shader" path="res://player/model/materials/face_mat.gdshader" id="1_u8nh3"]
|
||||
[ext_resource type="Texture2D" uid="uid://ci7cn145ld3l5" path="res://player/model/faces/closed.png" id="2_r4pvf"]
|
||||
[ext_resource type="Shader" uid="uid://cn2hf5o4glv8b" path="res://player/model/materials/face_mat.gdshader" id="1_u8nh3"]
|
||||
[ext_resource type="Texture2D" uid="uid://dbag7f8i27ub1" path="res://player/model/faces/open.png" id="2_mx10w"]
|
||||
|
||||
[resource]
|
||||
render_priority = 0
|
||||
shader = ExtResource("1_u8nh3")
|
||||
shader_parameter/face_texture = ExtResource("2_mx10w")
|
||||
shader_parameter/intensity = 4.0
|
||||
shader_parameter/screen_color = Color(0.0784314, 0.556863, 1, 0.00784314)
|
||||
shader_parameter/screen_red_offset = Vector2(0, 0)
|
||||
shader_parameter/screen_green_offset = Vector2(0, 0)
|
||||
shader_parameter/screen_blue_offset = Vector2(0, 0)
|
||||
shader_parameter/pixel_size = 44.0
|
||||
shader_parameter/face_texture = ExtResource("2_r4pvf")
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
albedo_color = Color(0, 0, 0, 1)
|
||||
emission_enabled = true
|
||||
emission = Color(0, 1, 0.392157, 1)
|
||||
emission_energy_multiplier = 0.831129
|
||||
emission_energy_multiplier = 2.38987
|
||||
|
|
1
player/player.gd.uid
Normal file
1
player/player.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://ccpc121u6xmyf
|
|
@ -1,11 +1,11 @@
|
|||
[gd_scene load_steps=19 format=3 uid="uid://ciqrpd5675boy"]
|
||||
|
||||
[ext_resource type="Script" path="res://player/player.gd" id="1_pdbxc"]
|
||||
[ext_resource type="Script" path="res://player/camera_controller.gd" id="2_2fob2"]
|
||||
[ext_resource type="Script" path="res://player/audio_listener.gd" id="2_4csdy"]
|
||||
[ext_resource type="Script" path="res://player/camera.gd" id="3_qxleh"]
|
||||
[ext_resource type="Script" uid="uid://ccpc121u6xmyf" path="res://player/player.gd" id="1_pdbxc"]
|
||||
[ext_resource type="Script" uid="uid://dwxcjtn7c1ei4" path="res://player/camera_controller.gd" id="2_2fob2"]
|
||||
[ext_resource type="Script" uid="uid://o63ivg4s4l5o" path="res://player/audio_listener.gd" id="2_4csdy"]
|
||||
[ext_resource type="Script" uid="uid://c54m6p83hnjyl" path="res://player/camera.gd" id="3_qxleh"]
|
||||
[ext_resource type="PackedScene" uid="uid://c0mo8tek77du4" path="res://player/model/character_skin.tscn" id="3_ufinh"]
|
||||
[ext_resource type="Script" path="res://ui/floating_nickname.gd" id="6_f61mk"]
|
||||
[ext_resource type="Script" uid="uid://74phah5dnq4x" path="res://ui/floating_nickname.gd" id="6_f61mk"]
|
||||
[ext_resource type="Resource" uid="uid://rclnl7v8k722" path="res://user_data/user_data_events.res" id="7_bgpps"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_8x2xm"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue