Raycast multiple lines

I have a 3 ray casts that are drawn, but when they are colliding different objects it starts not working right?

Do you only have one shape painter? Pretty sure it can only do one line at once.

1 Like

Ive tried with individual shape painters for each angle but that has the same effect.

You see this. You will get the idea about how raycast works

1 Like

Wait, maybe I’m not understanding what you’re trying to do.

Your events right now say “If all 3 of these rays intersect with hitscan, then draw three lines”

Your video matches exactly what the events say.

What is it you’re actually trying to do?

1 Like

I think, and I’m having a bit of a guess here, it that when the raycasts hit an object, the lines are drawn from the player to the the point of impact.

However, the problem OP is having is that if one or more of the raycasts doesn’t hit an object, all 3 lines are drawn out, even through the objects that the line should have stopped at.

In this image the top line (and possibly the middle one) should stop at the black horizontal block. But it goes right through:


@Jimpa, what happens if you break the 3 raycast event into 3 separate events, each with only 1 draw action for each?


Yeah sorry for not responding that fixed it. Thanks man.