add client prediction
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
extends State
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
if not multiplayer.is_server():
|
||||
if not multiplayer.is_server() and (multiplayer.get_unique_id() != subject.player_id or not subject.client_prediction):
|
||||
return
|
||||
|
||||
var target_velocity = Vector3(0, subject.velocity.y, 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends State
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
if not multiplayer.is_server():
|
||||
if not multiplayer.is_server() and (multiplayer.get_unique_id() != subject.player_id or not subject.client_prediction):
|
||||
return
|
||||
|
||||
var target_velocity = Vector3(0, subject.velocity.y, 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends State
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
if not multiplayer.is_server():
|
||||
if not multiplayer.is_server() and (multiplayer.get_unique_id() != subject.player_id or not subject.client_prediction):
|
||||
return
|
||||
|
||||
var input_direction = %Input.direction
|
||||
|
||||
@@ -14,7 +14,7 @@ func _change_state(new_state: State) -> void:
|
||||
current_state.exit()
|
||||
|
||||
current_state = new_state
|
||||
print("Entering: %s" % current_state.name)
|
||||
#print("Entering: %s" % current_state.name)
|
||||
current_state.enter()
|
||||
|
||||
func process_physics(delta: float) -> void:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends State
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
if not multiplayer.is_server():
|
||||
if not multiplayer.is_server() and (multiplayer.get_unique_id() != subject.player_id or not subject.client_prediction):
|
||||
return
|
||||
|
||||
var input_direction = %Input.direction
|
||||
|
||||
Reference in New Issue
Block a user