No matter in which way i shape the code i havent been able to get the raycast to be perfectly oriented towards the lookvector.
The script outputs that the raycast is not hitting anything, which should not be possible considering the origin of the raycast is located within 6 walls, therefore the sky is not visible at all.
picture of where the raypart is located: (imgur.com/a/h7j1kZh)
Heres the code:
while true do
local result = workspace:Raycast(script.Parent.startP.Position, script.Parent.startP.CFrame.LookVector)
if result then
local newpart = Instance.new("Part", workspace)
newpart.Position = result.Position
newpart.Shape = Enum.PartType.Ball
newpart.Size = Vector3.new(0.1,0.1,0.1)
newpart.BrickColor = BrickColor.Red()
newpart.CanCollide = false
newpart.CanQuery = false
newpart.CanTouch = false
newpart.Material = Enum.Material.Neon
wait()
newpart:Destroy()
else
wait()
warn("No raycast result!")
end
end
Thanks to anyone that helps in advance

2 comments
oh, i never understood what that * x meant at the end of it, ill check it out tomorrow and see if it works. also, just to tell you i sometimes with some solutions have an issue where the lookvector isnt exactly the face, sometimes its offset to the side and its rotation only matches up every 90 degrees so ill see if this solution works.
works perfectly and no offset, i cant thank you enough!