Download

Creating laser beam to walk on

Hi, I want to create laserbeam to walk in similar to the one in portal. I dont know if its my bad but I can’t find any tutorial for that.

I guess I need to adjust a mesh the size of a raycast but I am new here and dont know what to do.

thanks in advance

@fapocalips:

Could you maybe provide us a video link, where the laserbeam feature in portal is shown? That might make it easier to understand, what you actually want to do. I might be able to help you further :). If you can, explain it in more detail. Then we might have more of a clue, what you exactly want to do :).

of course here an exemple

the blue laser bridge

that looks more like just a plane with a fancy material on it to me…

It not the visual that I want to know how, its the behaviour

all of it is pprecited but what I want is how to create some kind of dynamic surface that the player want to walk on it an with a scale that transform when he hits a obstacle, like a walkable beam, its no the visual im interested in

Matinee, Sequencer, Timeline… can all animate moving drawbridge affect.
Or you can use Transform and change the scale of the walkway in a loop.
Or use SetActorLocation / AddActorOffset to move the walkway in a loop…
Search for threads that cover ‘moving platforms’, if that’s what you need…

I ll try but I really don’t think its that.

What I want is really some king of laser thatgoes from a point(any point)and stop when he hit an obstacle but this laser is a walking surface

What you want to do is use a linetrace from the origin until it hits something. From there, break the hit and get the Impact Location. Do Get Actor Location - Impact Location -> Vector Length to get the distance. Use this distance to scale the mesh in the X axis using proportions :slight_smile:

that sound more like it thanks

Do you mind giving me extra help. I know you helped me greatly but I tried this solution and I guess I still dont exactly get it this is What I have so far

eca92535b1055e4e2e1b9cafc4d35eacaa362907.png

The mesh scale appropriatly but does not stop when the linetrace hit smething, I am not sure what is wrong,

Thanks again

Hi Fapocalips,

A few things to try out.

On the line trace, select Draw Debug Type dropdown and select “For Duration.” Now you can see the actual ray…is it hitting something and stopping? Or is it going thru geometry?

Another thing, Make sure the vector length is correct. I would still explicitly do Actor Location - Impact Point -> Vector length just to be safe.

Also, you want to resize the mesh by using dividing the distance by the mesh size (proportion).


Yup the trace work fine, it is red and become green when hit something, Your code is interesting but I am curious, what is the purpose of the spline in this context

Hmm, if the hit is correct then its probably something to do with the mesh scaling calculation. The code above is from my road builder tool. Im using a trace to get the distance from the track to the floor and scaling the “support.” You can see the tool working here:

Just wanted to say that I finally make it work , greatly thanks for all your help

Good to hear! Funny enough I just made something similar for my current project - a laser beam that resizes based on the hit location and was about to check in on you lol :slight_smile:

To be honest I did something a little more simpler I think, I can show you the blueprint if you want, its something that might not fit all the need that being said because in my project, the laser is coming from a squre so it will always go in the same direction in the x,y axys