Distance beam (ray)

You can use Trace Line (thets Raycast in UNity) i only dont know how to make it shoot from specific points example i want to shoot from every bootom corner to ground at 90 degree

anywey youst then just calculate Trace Line start Position - Trace Line Hit Position

I make smart car… :slight_smile:

How can i do determination of the distance using a beam?

And display the distance to the obstacle (collision)?

What you want is to set up components around your car that will keep their rotation but stay with the car always. Each of these components can be set up to shoot a trace. It takes a bit of tweaking to make sure that your components are all facing the proper direction but it works fairly well otherwise.
Here is a video example of the result from my front right component.


I chose to print the return actor but you can use the Location return instead and get the distance between both points buy using a subtract vector with vector length node as answered on this post

If there is any nodes shown in the example that you do not understand, just ask :slight_smile:

Another important part is to make sure that your blueprint with the components to use trace is always staying with your car but not changing rotation. To do this just use Set Actor Location plugged to a tick event or timer to constantly refresh the position of your tracers on top of the car actor.

Note: You shouldn’t have to lock the axis like I did. But it doesn’t hurt.

thank you for the response! :slight_smile:
much obliged :slight_smile:

can be useful (line trace, beam)

Yes, nice tutorial :slight_smile: