#Enemy AI

1 messages · Page 1 of 1 (latest)

half tiger
#

So, thats the first time i try to make an enemy in my life. Basically, i want it to have two "sight ranges" and if the player touches it, the enemy will change it state to the running state. Also, if the player is on a certain state (down state, that means hes falling) and it touches the hurtbox, it should kill it, just like in mario games. I don't know if thats the best way to make it (i mean, the sight boxes and etc), so i'm really accepting advices, suggestions and etc.

And heres the main question: How am i supposed to make the enemy detect the player's state when it enters the collision box? Signals?

(thats a only-learning purpose game, im priotizing learning instead of making a really good game cause thats not supposed to be played someday, im even using free assets!!)

#

Enemy AI

muted cape
#

if you want, you can have the hero send its state to all enemies it contacts with, and then they can send a signal to the hero on how to respond to that contact

#

for other things, like if you want monsters to ignore your hero while they're in a defensive stance, you can send that signal to enemies when you change state (or an enemy is spawned)

#

many ways to handle this

obsidian bay
half tiger
#

Oh makes sense since he doesn't need to jump to get velocity.y > 0 but needs to jump to get the state down

#

im just not sure how to pass informations from the player to the enemy script

#

m8 i'm missing something from the documentation

half tiger
obsidian bay
#

No, what I meant was making another hurtbox on its head that kills the enemie . So you don’t have to check the player’s state and can just kill the enemy when he enters that box

half tiger