Local unitRay = camera:ScreenPointToRay(,, 0) RaycastParams.FilterDescendantsInstances = local raycastParams = RaycastParams.new() This will take the mouse’s x, y position and convert it to a unit ray. I use Camera:ViewportPointToRay(x, y, 0). I’m guessing you want to get the 3d point from the mouse, no? RemoteEvent:FireServer(inputObject.Position)ĬontextActionService:BindAction("ClickObject", mouseButtonClick, false, 1) Local function mouseButtonClick(actionName, inputState, inputObject) Local ContextActionService = game:GetService("ContextActionService") You can set up a debounce as such: - Local script When the player clicks down on the button, it will fire the server, sending the x, y coordinates to the server. If you use my method, you will get the player’s mouse position each time they click the left mouse button.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |