How to use Beam Emitter to predict projectile trajectory?

Hey all
I want to use a beam as a sort of laser to predict where my projectile lands, the weapon is like a catapult so the trajectory is curved. I’ve read a question on this forum that is the same as mine here How to create Grenade arc using Blueprint? - World Creation - Epic Developer Community Forums , however the answer shows you the solution with debug lines. I want to use a beam emitter instead.

Please help me with this! (with pictures, if possible!)

My current beam nodes (It doesn’t predict the projectile trajectory)


Bump…

bump2…

Beams can be a bit tricky, so you might need to play with this setup a bit to get it working…

You can use Beam Source and Target module setup in your Blueprint. If you set your two modules to UserSet you should be able to define the Source and Target in your Blueprint. If you are doing a line trace you can set the Hit Location to your New End Point.

25723-beamtarget.jpg

To track the projectile trajectory you will need to modify the beam tangents and update the beam every frame.

Honestly this is the sort of setup I usually work with a programmer to figure out as it can get tricky to figure out the math for the tangents to create an arc accurately.

Well, he gives you some math you can try out in the other thread…

“probably. beam emitter is not really designed for interpolating between points you create, so you might want to write your own version of beam emitter, but if you want to use the standard beam emitter, you would need to have target actors that you move into the first and last point position, and calculate the tangents by subtracting the first point from the second point to get the first tangent, and subtract the last point from the penultimate point, for the second tangent. if you calculate bank shots, you will need several separate beam emitters spawned at every collision, and since that would be expensive to spawn those in all the time, you should have a small pool of beam emitters that you move into place and keep alive for as long as the weapon is equipped.”

You’ll need to setup your Source/Target modules to use an instanceParameter for the tangent settings so you can modify them on tick in your BP.

25728-beamtangents.jpg

Ahh, all of this does sound tricky indeed. I’ll try at it today and see how I fare.

But do you know of an easier method to predict and draw projectile trajectory aside from this and debug lines? Debug Lines aren’t really good for eye-candy, and the method involving Beams above sounds a bit complicated for me who is extremely ignorant at programming.

Someone said you could do it with Spline meshes, but when I inquired further he didn’t answer back.

I don’t know of a simpler method for doing this. I haven’t played with our spline meshes yet, but my guess is you would still need to do some setup/math to get the proper arc displayed…there is no “dead simple” method for doing targeting like this I know of.

This simple tutorial solved all my issues in recreating a trajectory arc through beam emitters: UE4 Projectile Trajectory Tutorial : Part1 - YouTube