Enabling Visible Raycast

Hello, everyone. I am currently working on a game and I am using Raycast. Now, I wanted to see the raycast and do debug kinds of stuff but turns out

There is no way to see the raycast line. So, I am making a feature request here, to see the raycast line.

And another question, does raycast sets its rotation with respect to its origin? For example, its origin is obj.Point(“ray”), and when obj rotates, the point rotates. Now, if obj’s angle = 50 and ray’s angle = 90, will its angle turn into 50+90 = 180?

What I am trying to say is this:

Note: Its 0 degree, not o degree

See there, when the obj is 0 degrees and the point is where it should be, the raycast is pointing upwards. Below that, you can see that when the obj is 90 degrees, raycast will rotate with it. Now, my question is, does this happen?

1 Like

I like the idea. However, a raycast only lasts for the event/frame. The debug drawings are for fixed and permanent properties. So it’d be pointless to visualise the raycast, as it potentially may only be on screen for a frame (a fraction of a second)

Raycasts use absolute angles, not relative. They are not linked to an object, but go from a point out, so an object’s rotation has no impact on the raycast. Whether that originating point is a point defined by an object or if it’s some arbitrary position is of no concern to the raycast function. It just requires a staring point.

1 Like

If you want to see a raycast line use the shape painter like this.

always use raycast angle if you want to offset the angle of the line.

1 Like

It’s alright. I just asked for checking some stuff, and now I’m Okay,

If you want to visualize the line raycast draws, this is the only way I know of to do it.

1 Like