Can I scale a collision box (trigger) once the game has started using something like a delay + scale?

Hey,

So I’m pretty new in game development and I’m doing a game where the enemies follow the player when he enters the box collision of the enemy. (meshes are still the ue4 defaults btw)

Enemies spawn at random points of the map.

Problem is: if when the enemy spawns, the player is already inside the collision box, the enemy will not follow him, because the overlap event will not trigger (I guess).

So I thought, maybe I could do a small collision box and then, like 1 second after the enemy spawns, make it scale to a bigger size so it detects the player wherever he is.

I thought I may do it with a delay of 1-2 seconds and then scale the box.

Do you think it’s a good idea?
Anyone has a better solution to solve the problem?

Thanks!

Thanks , I’ll have a look at that!

I suggest you read/watch the AI Tutorials! The tutorial shows you how to make a monster which goes to the player when he enters it’s radius and even follows him (and returns to the startpoint when he loses sight for too long).

In short: It has a behaviour tree and uses raycasts to “see” players.