How to create trigger box arrow attack ?

I am creating a game and i wanted to create a mechanic in which whenever my character step on a wrong box , i get arriws hit from a statue . If anybody knows how to create such mechanic , then pls help me

Thank you

Well, there are many approaches to that, first thing that comes to my mind is following:

  • Set up an actor blueprint with a floor tile mesh and a trigger volume above (check height if the player should be able to jump over it)
  • create a projectile spawning function in that actor and get a reference to the statue (by getting by class e.g.), spawn projectile using the location of the statue and the trigger box (vector calc the direction).
  • if the projectile should be just visual (e.g. damage applies instantly non avoidable) apply damage to overlapping actor (probably cast to controller if you handle health there), if you want the player to be able to avoid that damage by acting quickly, let the projectiles hit apply the damage and give the player feedback on the trigger and enough time to react.

Rough design, but a start and hopefully an inspiration for you.

1 Like

Thank you for your answer but how will arrows work there ? , like what it will need to shoot arrow from statue

Create an basic actor blueprint, set a static mesh that looks like an arrow. and a projectile movement. with that blueprint set up you cant spawn an arrow with a given direction.