- Home /
moving AI up/down if lower/higher in Sector as player
Hey Guys, I'm coding a game with an End-Boss. I decided to move him like this: if player in sector 1 (there're 1-6 sectors) and the AI in sector 6, AI moving upwards. if player in sector 6 AI moving downwards. The sectors were made with 2D BoxColliders (OnTrigger). now I have a problem to find out in which sector the player is, and how to move the AI. Does anyone have a script like this or could help me on this problem?
Sincerely
Niklas
Hey my man, I feel like more information will need to be provided. How are you handling the movement? How does the player enter or exit the sectors? You say there are 6 sectors but if the player is at sector 1 the AI must move upwards? Upwards to where? Physically? To sector 7?
Hey, sry, its like this on the left side of the screen is moving my character (only on the y axis) he only can move up and down, on the right side of the screen is the AI which is moving up or down when the character is above or under the AI. So i thought i split my screen into 6 sectors (sector 1 is on the top and sector 6 on the bottom, between them 2,3,4,5). The sectors are used to spot wheres the Character is, and how the AI has to react on this information. But I dont know how to do it.
Your answer
Follow this Question
Related Questions
2D Platformer Ai Movement Decision Making Problems 0 Answers
Simple AI In 2D - C# 1 Answer
enemy AI patrol not working 1 Answer
How to make basic AI in a 2d game? 4 Answers
aquarium effect for 2d fish 2 Answers