I am planning to create a placement system for my tower defense game. I’m just not sure how I would go about it? All I want to recieve from the client is a position in the workspace. I don’t care if it is a fake position as long as it is a possible position anybody could place it in. I am just not sure how to do this? I have considered creating a tiny part and using GetTouchingParts() but I am not sure that it’s the best method.
TL;DR
Register if a position in the workspace is a valid placement
Well if you have a mouse raycast then that’d be good cause then you could make a folder of placeable spawns and check if the MouseRay.Instance.Parent is equal to that folder
How could I process this information on the server? It seems like if I try to send this information over to the server they could still exploit it, or am I missing something here?
I found the solution. You need to send a player’s mouse position (via UserInputService:GetMouseLocation()) and a unitRay (workspace.CurrentCamera:ScreenPointToRay()). After that, the server casts a ray using all the parameters mentioned. Check if it is a valid ray, if it has an instance, and if it is a descendant of the placement part/folder.
Ooh, you’re right. How could I verify the origin of it, though? I’d assume the server’d have to check but how would the server know if the origin is valid or not?