I am trying to get the client’s camera properties like CFrame and Focus, and
I want to know what ways are there to get the client’s cameras properties.
I am currently using remotes to poll for the client’s camera which I don’t find efficient.
Because constantly polling even if the camera had not moved would be a waste of computational resources. In situations like a server with 50 clients, I’m worried if it will hurt performance.
Maybe I could instead FireServer() from client when there’re camera movement.
Oh! I was under the assumption that was the case already, I misunderstood.
I would definitely only send this information when the camera is moved. On top of that if you’re really concerned about how this will scale with player count, I would enforce a minimum time between each update by some small value (ie, 1 request every 0.5 seconds). If the camera changes during the waiting period, save the value and send it as soon as it can.
Most of the assets are stored in server storage to reduce live parts count and load in times.
Some parts are also procedurally generated on server side so I need to know if the player’s camera or Root Part is near those chunks to regenerate, otherwise the instances gets destroyed.
Are you procedurally generating parts to help performance? If so, I strongly recommend not doing that. Stick with StreamingEnabled or no chunks at all. It’s worse than just dealing with a larger map in the long run.
I’ve sent client camera CFrames to the server for debugging and spectating purposes. For example: Player A says he’s found a map glitch, I can click a button on my admin panel and see what this player is looking at without having run to them, or teleport, and then try to guess which direction they’re looking.
Of course there are situations where the server does need access to this information, I was not suggesting otherwise. Sometimes though there are better ways to achieve a goal by thinking more generally about the overall problem than a specific area. That’s what we have user stories for.