Interaction brought back
This commit is contained in:
parent
2c7903e95d
commit
66e8707940
6 changed files with 23 additions and 11 deletions
|
|
@ -244,11 +244,9 @@ func shoot(id:int , damage: int, distance: float) -> void:
|
|||
collision["collider"].take_damage(damage)
|
||||
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func interact() -> void:
|
||||
func interact(id: int) -> void:
|
||||
if multiplayer.is_server() == false:
|
||||
return
|
||||
var id = multiplayer.get_remote_sender_id()
|
||||
|
||||
var player: Player = player_nodes[id]
|
||||
var player_camera: Camera3D = player.get_node("Camera3D")
|
||||
|
|
@ -264,11 +262,9 @@ func interact() -> void:
|
|||
if collision != {} and collision["collider"] is Interactible:
|
||||
collision["collider"].interaction_start(id)
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func stop_interact() -> void:
|
||||
func stop_interact(id: int) -> void:
|
||||
if multiplayer.is_server() == false:
|
||||
return
|
||||
var id = multiplayer.get_remote_sender_id()
|
||||
player_stopped_interacting.emit(id)
|
||||
|
||||
func is_on_site(id: int) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue