I am trying to create a laser beam that comes out of gun. But instead of it covering the whole width of the layout I want it to expand to the point where mouse pointer is currently at.
I am using [quote:3j0g0ipt]distance(player.X,player.Y,mouse.X,mouse.Y)
Works fine, but I want it to stop on a solid object which is in the way. So if pointer is behind the solid, the laser shouldn't cut through it, rather stop at the solid. So how can I achieve this?