How to make something fly away on spawn in Unreal Engine

- by

I’ve been dissecting an old project of mine and couldn’t remember how the projectiles I was shooting happened to magically fly away when they were spawned. They seemed to have an initial velocity or inertia in the forward direction, yet nothing in my Blueprint was causing this. Then I figured it out: we had added a Projectile Movement component to the class, which does exactly that: add velocity and gravity to such objects.

All that was necessary to add velocity was to add the object to my blueprint. It automatically parents itself to the root node, and as such works a bit like a Character Movement component (albeit much simpler).

With it selected, we now have some additional parameters to access. The most important ones are Initial Speed (0 by default) and Gravity Scale. The latter will drag the projectile down over time. This thing can be used for fast flying bullets, but also for slower objects like honing missiles or even things like magic effects gathering around a character or fireflies around a light source.

Mathew has a video with more gory details about this thing.

If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment