I’m making a raycast on a loop that shoots straight down and using the result to position an attachment for a beam effect
It seems to not hit the ground until a certain distance. (~150 studs or so as I’ve tested I’ve positioned it under different objects with different heights)
Here is a video link that shows it only working on a certain height (the print only works if the raycast hits something, its in an if statement): https://youtu.be/JjU3bzsgBUA
(In the video it always hits a not-so-constant 200 studs before working)
I’ve tried moving the raycast down, looking on the forum, and changing the angle but no luck.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
This is the “while true” loop in the script I’m talking about
while true do
local mPos = script.Parent.Missile.Position
local result = workspace:Raycast(Vector3.new(mPos.X,mPos.Y-3,mPos.Z), Vector3.new(0, -180, 0))
if result then
print(part.Position.Y)
part.One.WorldCFrame = CFrame.new(Vector3.new(result.Position.X,result.Position.Y-1,result.Position.Z))
end
wait(1/45)
--print(part.One.WorldPosition)
end