Download

How to move a flying pawn around an object?

Hello, I want to create a flying drone for my spaceship game, which enters the spaceship through the hangar. Now I struggle with how I can make it fly around the spaceship, if it comes from the other side.

What is the best way to tell a flying pawn to move around an object, so that it doesn’t just try to fly through said object?

Thank you for your help!

Create a circular, closed spline and move the drone along it with a Timeline track.

Or add a Camera Boom, attach the drone to the boom, rotate the boom (which can be a Child Actor with a Rotating Component, for example).

Or use math to find a point on the circumference and set the drone’s location there (updated in Tick).

Or, the most simple solution, attach the drone to the Mothership, give it an axis offset and rotate locally (setting the offset can serve as an animation of the drone emerging from the hangar - so win-win)

All of the above should work OK. There’s probably more solutions, too - all depends how you want it to feel like, how modular the system needs to be and how much overall control is needed over the trajectory.

You could, for example, rotate a dummy, locally offset object (or rotate a vector on an axis) and have the drone chase the dummy using vInterp. The interpolation scale can be modulated over time, giving you smooth yet slightly unsteady movement; if that’s what you’re after.

Pick you poison.

Not sure if you need this for drone, but maybe you want this for enemy logic: (BOIDS)

Dynamic obstacle avoidance, tracing maybe…
Anyone test-driven this free option ‘indoors’?