Humour me if I did something stupid, this is my first time trying raycasts
I want the ray to hit anything but the player, though no matter what I try, it still hits the local player, any help is appreciated
local length = 1000
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = {character}
local raycastResult = workspace:Raycast(camera.CFrame.Position, camera.CFrame.LookVector * length)
print("Instance:", raycastResult.Instance)
1 Like
txcIove
(txcIove)
January 13, 2024, 4:37pm
#2
You’re not applying the raycast params on the raycast. Use this code sample as a guide.
3 Likes
oh my god how on earth did I not notice that I hadn’t added the parameters
thank you
2 Likes
I was just about to say the same thing, you beat me to it though
3 Likes
txcIove
(txcIove)
January 13, 2024, 4:51pm
#5
No prob, in the future make sure to look over the Roblox API Reference as looking for issues there usually is faster than here, and it also helps you learn.
1 Like
system
(system)
Closed
January 27, 2024, 4:51pm
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.