Server Authority : InputBinding Mouse Position returns Vector2.new(-1, -1) on server

Hello,

I’m currently experimenting with the new Server Authority / BindToSimulation system and I’m trying to implement a vehicle/turret aiming system.

I created an InputAction with an InputBinding using Mouse Position. On the client side, I correctly receive the mouse position as a Vector2 containing the viewport coordinates.

However, when I try to read the same input on the server during the simulation, the value is always:

Vector2.new(-1, -1)

Example:

local mousePosition = aimAction:GetValue()

print(mousePosition)
-- Server output: -1, -1

I understand that the server does not have access to CurrentCamera, but I was expecting the InputAction system to replicate the input value to the server, since it is part of the Server Authority workflow.

My questions are:

  1. Is Mouse Position supposed to replicate to the server?
  2. If not, what is the recommended way to handle mouse-based aiming with Server Authority?
  3. Should the client convert the mouse position into a world-space direction/ray and send that instead?
  4. Is there a recommended pattern for doing this inside BindToSimulation()?

My goal is to have the server remain authoritative over the turret/vehicle simulation while still allowing the player to aim using the mouse.

Thanks!

1 Like

Real solution:
Never add bindings to server authority-bound input actions
Always fire them yourself instead
Etc :Fire(Vector2.new(X,Y))

That’s how I handle it in FPX, having server authority actions under player and actual bound actions under replicated storage that then fire server bound ones from replicated storage actions
This is also advantageous because you can send to the server already processed data, etc., send the global movement direction, and this way, there is no need to send the camera.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.