#Raycasting Bug
1 messages · Page 1 of 1 (latest)
Watch Mouse isnt moving yet the raycast is deflecting into weird angles by thedictator3011 and millions of other Roblox Studio videos on Medal. #robloxstudio
Was shown like this for a general showcase that it can be consistently replicated but it is even more random and annoying when someone is just jumping around and you're trying to shoot them
bump
maybe instead of mouse.Hit.Position try getting mouse position like this:
local camera = workspace.CurrentCamera
local mouse2Dpos = UserInputService:GetMouseLocation()
local mouse3Dray = camera:ViewportPointToRay(mouse2Dpos.X, mouse2Dpos.Y, 1)
local result = workspace:Raycast(mouse3Dray.Origin, mouse3Dray.Direction * 1000, params)
local mousePosition = result.Position or mouse3Dray.Origin + mouse3Dray.Direction * 1000
also render bullets on clients instead of the server
If I want every client to see the bullet dont I want it to be on the server? Or is there a better way.
** You are now Level 1! **
You can make so client that's shooting creates bullet instantly after shot and then server sends remotes to all other clients to create bullets. It's not necessary but makes gun more responsive and reduces server load
I haven't done the server stuff but I tried to get it how you reccomended. Just like this? It's working but I'm not sure if I did it right.
Gun feels more responsive but its still having the same issue