Hi, I am trying to get the exact position of a Part in a Tool and a Part from the Workspace colliding together. I need the position so I can place something there. I already tried Raycasting but it didn’t seem to work. It always caused errors in the script. To be honest I dont know how to use Raycasting because I never used it before. Do I really need to do that with RayCasting? Or is there a diffrent way?
Here’s a picture so it might be better to understand:
If you are Raycasting using workspace:Raycast, If you want the Exact Position on where it Intersected the Object, it would be Result.Position, but if you want it to be outside of the part but touching the Part, you add the Position plus the Normalized Position which is Result.Position + Result.Normal
I already tried many ways like this but when I use anything with Raycasting
(like this):
local RayCastParams = RaycastParams.new()
local rayOrigin = Touched.Position -- Part in the Workspace
local rayDirection = script.Parent.Handle.Position -- Part inside a tool inside the character
local raycastResult = game.Workspace:Raycast(RayCastParams, rayOrigin, rayDirection)
it trows this error:
“Unable to cast Vector3 to RaycastParams”
I also tried to fix it somehow but that didn’t work