Hello!
I’ve spent many hours the past several days trying to figure out how to have a laser/energy blast shoot from a moving vehicle at a proper velocity.
Here is the setup:
Hero Ship, Blueprint Class of Pawn. Has the Arrow as part of the hierarchy so that the laser blast can spawn at the correct coordinates. Max speed of the ship is Mach 2 displayed in the HUD as KPH, in this case, 2414 KPH. My understanding, and please correct me if I’m wrong, is that movement in UE 5.1 is centimeters per second. So the max speed of the ship is 67056 CM/S.
The projectile is also a Blueprint Class of Pawn and has a Projectile Movement Component as part of it’s hierarchy. It’s initial speed is 15000 CM/S.
Everything is fine, as you might imagine, to a point; I pull the trigger on the controller, the laser bolt spawns from the correct coordinates and follows the correct vector.
The problem, as you’ve probably already guessed, comes about when the ship’s velocity nears that of the laser bolt. In this case, once I’m at about 460 KPH, the laser bolt is significantly slow, and at 540 KPH, it’s starting to come out backwards.
What I have been unable to figure out, is how to dynamically increase the velocity of the laser bolt’s Projectile Movement Component so that as the ship’s velocity increases, the velocity of the Projectile Movement Component has also been increased.
Increasing the Projectile Movement Component’s Initial Speed before it’s spawned hasn’t worked, and changing it’s velocity after it’s spawned hasn’t worked either.
I’ve seen quite a few questions that are similar, but any solutions that have been provided I cannot get to work.
If anyone can point me in the right direction, I sure would appreciate it.