I would like my NPC to shoot straight projectiles (no gravity) at the target. It seems if I change the “override gravityZ” input on the “suggest projectile velocity” nodes, it completely breaks. Maybe I just dont understand what the gravity input was supposed to mean.
My projectiles work just fine with default gravity, but if I want to shoot ones that dont use gravity, the node breaks completely. Anyone know how to use the node for projectiles with no gravity?
You don’t need Suggest Projectile Velocity.You can set directly the projectile Initial Speed in the projectile movement component.
I think Suggest Projectile Velocity is the result of a ballistic calculation in gravity. The idea is to provide a distance and an angle, the system will calculate the arc and suggest the velocity needed to reach that distance. At least as far as I remember.
The problem is im trying to make a pooled projectile fire at a player. so initial velocity isnt used. Im setting the velocity after calling the projectile from a pool
I set the projectile location, then make it visible, then set its velocity.
The suggest velocity node works really well for this. but only if gravity is default
the node breaks at zero gravity because there is no arc to solve, the math divides by the gravity magnitude so zero gives garbage. with no gravity the answer is just direction times speed, take the vector from muzzle to target, normalize it and multiply by your projectile speed, then set that as velocity when you pull from the pool. keep the projectile movement gravity scale at zero too so flight matches the straight line you aimed.
you can also try Gravity & Ballistics Toolkit, a zero g projectile kit for Unreal Engine that aims straight shots and predicts paths where gravity is turned off: Gravity & Ballistics Toolkit — Planet Gravity, Zero-G & Arc Prediction | Fab