#hey i need help with raycasting

1 messages · Page 1 of 1 (latest)

frosty sonnet
#

les go

river hornetBOT
#

studio** You are now Level 2! **studio

frosty sonnet
#
local start = game.Workspace.start --assuming you have a part in workspace named start)

local End = game.Workspace.End --assuming u have a part named end)

local direction = End.Position - start.Position

local params = RaycastParams.new()

raycastParams.FilterDescendantsInstances = {game.Workspace.Baseplate} 
raycastParams.FilterType = Enum.RaycastFilterType.Exclude 

        local direction = End.Position - start.Position 
local raycastResult = workspace:Raycast(start.Position, direction, raycastParams)

if raycastResult then 
    print(raycastResult)
    
end
#

ima go now bye

next ice
frosty sonnet
#

hey can u help tho

#

@next ice

next ice
frosty sonnet
#

me

next ice
#

what was with all the comments you deleted?

frosty sonnet
#

i added some comments

frosty sonnet
next ice
next ice
# frosty sonnet it was me

that's not what the code comments suggested, and it would be nice if you left them in/added them back in for better understanding what is going on with this since you don't describe what the problem is (if any). either way, whoever wrote it, the advice doesn't really change; use https://create.roblox.com/docs/reference/engine/datatypes/RaycastParams#AddToFilter instead of setting .FilterDescendantsInstances directly (i've found setting the table directly to be a bit glitchy), and make sure your ray isn't backwards (negate the direction), and take steps to guarantee the ray will hit something (i.e make sure the code is running without errors or warnings incl. waitforchild infinite yield warnings) etc also given the simplistic nature of the code you show (proof of concept by the look of it), maybe add a task.wait(5) to the top so it waits 5 seconds after the game starting before the ray is cast, beyond all that, more details bruh

A container for parameters used in raycasting operations.

lavish mulch
next ice
frosty sonnet
#

its me

#

i put it in notes so that way when im coming back i know

#

@lavish mulch

lavish mulch
drifting verge
#

@next ice

drifting verge
frosty sonnet
#

?

lavish mulch
frosty sonnet
#

the script wont print raycast result

frosty sonnet
lavish mulch
frosty sonnet
#

wat