So I have a script and Im making a part to see where this raycast where fire to.
But there is a bug.
When ever I use this script it puts the part into the character and not 30 studs in front of it
Why is this happening?
local origin = char.PrimaryPart.Position
local rayDirection = origin + Vector3.new(CFrame.new(origin) * CFrame.new(30,0,0)) -- this is the position I need to send it to. Which should be in 30 studs in front
local part = Instance.new('Part')
part.Parent = workspace
part.Anchored = true
part.Position = rayDirection -- put the part where the position is