Mouse.Target and Mouse.Hit.P Bugging out?

So for the first 10 seconds everything works right then after 10 seconds it stops working

i have made the script print the target and mouse.hit.p

When it works:

10 seconds later when it doesnt work:

The script goes from, client to module to server

I found the cause was this line in another script

image

is their a way to make only that script ignore the workspace?

Hi,
The mouse variable is somehow shared between scripts. I dont know what causes that, but i think i got an solution that should work (I have no idea if it works i wrote it on mobile).


local viewpointRay = camera:ViewportPoinyToRay(mouse.X, mouse.Y,)

local params = raycastParams.new()
params.FilterdescendantInstances = {workspace} -- same as targetFilter
params.FilterType = Enum.RaycastFilterType.Exclude

local results = workspace:Raycast(viewpointRay.Origin, viewpointRay.Direction, params)


Helpfull topic:

i fixed by making it when the bow is equipped to set the targetfilter to workspace and when unequipped set it to nil so when you swap to the block tool it still picks up on workspace

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