Enemy AI Help

Hello, Everyone

In my game I have a character that runs and jumps across building rooftops and the enemies follow him. Currently, I’m using separate objects at the end of the buildings to making the enemies jump on contact. But I’m running into problems with this, so I’m wondering if someone would help me with how to detect where the enemy is on the building so that I can making it jump when it gets to the end with out having to use the extra objects. [import]uid: 208120 topic_id: 35325 reply_id: 335325[/import]

Anyone? I really need some help here please :slight_smile: [import]uid: 208120 topic_id: 35325 reply_id: 140490[/import]

What you’re doing sounds like it makes sense. I probably would have put an invisible block at the places where I want the AI to jump make it a sensor and use collision detection to see when the enemy hits the sensor. [import]uid: 199310 topic_id: 35325 reply_id: 140510[/import]

Im doing that right now, but its an endless game and so when everything jumps forward again the sensors become slightly out of place each time. [import]uid: 208120 topic_id: 35325 reply_id: 140524[/import]

Boil the code down to something easily posted here. Then you’ll either see the problem and be able to fix it or you’ll be able to post it here without risking your whole game source. [import]uid: 8271 topic_id: 35325 reply_id: 140525[/import]

I figured it out! thanks everyone! [import]uid: 208120 topic_id: 35325 reply_id: 140685[/import]

Anyone? I really need some help here please :slight_smile: [import]uid: 208120 topic_id: 35325 reply_id: 140490[/import]

What you’re doing sounds like it makes sense. I probably would have put an invisible block at the places where I want the AI to jump make it a sensor and use collision detection to see when the enemy hits the sensor. [import]uid: 199310 topic_id: 35325 reply_id: 140510[/import]

Im doing that right now, but its an endless game and so when everything jumps forward again the sensors become slightly out of place each time. [import]uid: 208120 topic_id: 35325 reply_id: 140524[/import]

Boil the code down to something easily posted here. Then you’ll either see the problem and be able to fix it or you’ll be able to post it here without risking your whole game source. [import]uid: 8271 topic_id: 35325 reply_id: 140525[/import]

I figured it out! thanks everyone! [import]uid: 208120 topic_id: 35325 reply_id: 140685[/import]