Good evening, I want to transmit head rotation to the server, but when I try to do this, nothing comes out, other players do not see your turn, help me please
server player script
extends Spatial
onready var head = $Head
onready var head_x = $Head/HeadXRotation
remote func updateplayer(transform):
rpcunreliable("updateremoteplayer", transform)
remote func updateremoteheadrotation(headrotationx, headrotation):
rpcunreliable("updateheadrotation", head.rotationdegrees.y, headx.rotationdegrees.x)
Client player script
func input(event):
if isnetworkmaster():
if not notepicked:
if event is InputEventMouseMotion:
head.rotationdegrees.y += sensitivity * event.relative.x
headx.rotationdegrees.x += sensitivity * event.relative.y
headx.rotationdegrees.x = clamp(headx.rotationdegrees.x, -89, 89)
elif event is InputEventKey:
if Input.isactionjustpressed("flashlight") and event.pressed and progressflash > 0:
timer2 = 0
flashlightlight.visible = !flashlightlight.visible
flashlightsound.play()
elif event.scancode == KEYSHIFT:
isshiftpressed = event.pressed
elif Input.isactionjustpressed("duck") and event.pressed:
iscrouching = !iscrouching
if iscrouching:
head.translation.y = CROUCHHEIGHT
else:
head.translation.y = STANDHEIGHT
elif event is InputEventMouseButton and not notepicked:
if ismousecaptured:
# release the mouse capture and hide the cursor
Input.setmousemode(Input.MOUSEMODECAPTURED)
ismousecaptured = false
notepicked = false
else:
# capture the mouse and show the cursor
Input.setmousemode(Input.MOUSEMODEVISIBLE)
ismousecaptured = true
var headrotationx = headx.rotationdegrees.x
var headrotation = head.rotationdegrees.y
rpcunreliableid(1, "updateremoteheadrotation", headrotationx, headrotation)
remote func updateheadrotation(headrotationx, headrotation):
if not isnetworkmaster():
head.rotationdegrees.y = headrotation
headx.rotationdegrees.x = headrotation_x