Hi,
What CFrame math would I need to do to project a CFrame in a direction by a fixed distance?
Examples/Problem that needs to be solved:
while true do
task.wait(0.1)
local Part = script.Parent:WaitForChild("Part")
Part.Position = script.Parent.Position + Vector3.new(0,0,10)
end
With no rotation, this code above positions the Purple part exactly 10 studs away from the Yellow part in the direction the blue Cylinder is facing.
With a 90 degree rotation, the relative position of the two parts is no longer in the direction the cylinder and yellow part are facing, like so:
I am aware that the code provided only changes the Z position of the Purple part and thus won’t account for a rotation, but I am completely stumped as to manipulating the CFrame of the Purple part to always get it projected an exact fixed distance away in the direction the Yellow part is facing. Any help would be greatly appreciated.