WIP: Some updates
This commit is contained in:
parent
ad7c3ea5f9
commit
75f482a548
@ -4,8 +4,8 @@ class_name CharacterWrapper
|
||||
@export var die_script: GDScript = null
|
||||
@export var owner_placeholder: CharacterBody3D = null
|
||||
|
||||
@export var interpolation_speed: float = 20.0 # How quickly the model corrects position
|
||||
@export var velocity_influence: float = 2.0 # How much velocity is used for smoothing
|
||||
@export var interpolation_speed: float = 50.0 # How quickly the model corrects position
|
||||
@export var velocity_influence: float = 1.0 # How much velocity is used for smoothing
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@ -24,7 +24,7 @@ func _physics_process(delta: float) -> void:
|
||||
global_transform.origin = global_transform.origin.lerp(server_pos, interpolation_speed * delta)
|
||||
global_transform.origin += velocity * velocity_influence * delta
|
||||
velocity = velocity.lerp(server_velocity, delta * interpolation_speed)
|
||||
move_and_slide()
|
||||
#move_and_slide()
|
||||
|
||||
# Set the owner placeholder, so the characters can send the requests to a node
|
||||
# it depends on
|
||||
|
@ -2330,6 +2330,7 @@ collision_mask = 0
|
||||
script = ExtResource("1_k4p2i")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
||||
|
||||
[node name="Body" type="Node3D" parent="Model"]
|
||||
transform = Transform3D(0.01, 0, 0, 0, 0, -0.01, 0, 0.01, 0, 0, 0, 0)
|
||||
@ -3020,6 +3021,7 @@ libraries = {
|
||||
}
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.951935, 0)
|
||||
shape = SubResource("CapsuleShape3D_gp5it")
|
||||
|
||||
[connection signal="body_part_hit" from="Model/Body/Skeleton3D/HeadAttachment/Area" to="." method="_on_area_body_part_hit"]
|
||||
|
@ -66,8 +66,9 @@ func _spawn_player_controller_node(x: float, y: float, z: float):
|
||||
player_node.shared_node.global_position = Vector3(x,y,z)
|
||||
controlled_node.bind_player_node()
|
||||
|
||||
func spawn_player_model(owner_node: CharacterBody3D):
|
||||
player_spawner.spawn_player_model(owner_node)
|
||||
func spawn_player_model(owner_node: CharacterBody3D, owner_id: int):
|
||||
if multiplayer.get_unique_id() != owner_id:
|
||||
player_spawner.spawn_player_model(owner_node)
|
||||
|
||||
func _remove_player(id: int):
|
||||
player_spawner.remove_player(id)
|
||||
|
@ -23,7 +23,7 @@ func _ready() -> void:
|
||||
shared_node.set_collision_mask_value(3, true)
|
||||
map_controller = find_parent("Map")
|
||||
_load_weapon()
|
||||
map_controller.spawn_player_model(shared_node)
|
||||
map_controller.spawn_player_model(shared_node, owner_id)
|
||||
# Load the default weapon and set the current attack properties
|
||||
|
||||
func _load_weapon() -> void:
|
||||
|
Loading…
Reference in New Issue
Block a user