movement sync
This commit is contained in:
parent
daa83ce96d
commit
bb3a14ece7
13 changed files with 46 additions and 35 deletions
|
|
@ -7,17 +7,10 @@ extends Node
|
|||
const ATTACK_LAYER: int = 0b10000
|
||||
const DEFENCE_LAYER: int = 0b100000
|
||||
|
||||
func on_spawned() -> void:
|
||||
func _ready() -> void:
|
||||
if is_multiplayer_authority() == false: return
|
||||
var mask = (ATTACK_LAYER if (player.team == Session.TEAMS.DEFENCE != inverse) else DEFENCE_LAYER)
|
||||
if layer:
|
||||
get_parent().collision_layer |= mask
|
||||
else:
|
||||
get_parent().collision_mask |= mask
|
||||
global_update.rpc(layer,mask)
|
||||
|
||||
@rpc
|
||||
func global_update(new_layer,mask) -> void:
|
||||
if new_layer:
|
||||
get_parent().collision_layer |= mask
|
||||
else:
|
||||
get_parent().collision_mask |= mask
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue