Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What does this piece of code mean in part of Raycasting Gun Script?

Asked by 7 years ago

beam.CFrame = CFrame.new(tool.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)

I have try to test this code out w/o this part: * CFrame.new(0, 0, -distance / 2), and length of the beam does not reach the mouse.hit.position and instead goes halfway. Can someone explain this part for me ( * CFrame.new(0, 0, -distance / 2) )?

[http://wiki.roblox.com/index.php?title=Making_a_ray-casting_laser_gun]

Answer this question