How to make enemies jump at player?

The Fish:

  • Rotation Follows Velocity so the fish fly head forward, hopefully
  • the fish deals damage to a hit pawn
  • the fish only live for 10s via Initial Life Span
  • there is an Exposed on Spawn and Instance Editable vector variable - New Velocity
  • that variable is set in the Construction Script - that’s how the projectile component knows the direction and force needed to launch the fish actor accurately (there’s no movement predication / target leading - so it’s easy to dodge, but can be added):

The Pond

It’s an actor that spawn fish when the player enters the overlapping collision:

  • when the player enters the sphere collision we start a looping timer, and stop it when they leave
  • the timer generates a random position in the radius of the collision sphere, but not too close to the pawn
  • the Suggest Projectile Velocity Custom Arc does the heavy lifting of figuring out the vector needed to reach the player

This is very bare (fish) bones and needs a ton of functionality to make sense. Hope it helps.

Project Link v4.27:

6 Likes