How to set and change enemy path in real time in game ?
Hello guys ,I have added the script to a cube which is my enemy object such that it will move over certain waypoints in a loop. The way points are set at 4 corners of square.
Now according to my game the player object (a different cube) can push other objects in scene other that the enemy cube. So I want that when player puts a object in the path of enemy , enemy should go around that object to next waypoint or turnaround to find the the path to reach to next way point.
Hope this make sense . I am at beginner level right now so I am in need of your help. On this logic only my whole game is based.
Thank you.
Answer by G4merSylver · Aug 14, 2016 at 09:31 AM
This is called path finding, and I wouldnt exactly call this something of the beginner level - if you are the one who will code this. The solutions that are offered also arent the cheapest ones. Alternatively you can try playing around with raycasts. Should you have the time I would recommend looking up the A* Algorytm. Note that one linked in the asset store is one that was optimized to unity.
Programming pathfinding is not beginner level.
Your answer
Follow this Question
Related Questions
Vertical Movement Is Wierd 1 Answer
Raycast Enemy AI shooting script 1 Answer
3D First Person Game, 2D Enemy Face Player/Camera 1 Answer
Making smart enemy AI using GOAP 0 Answers
How to make enemy detect a character in his certain range? 1 Answer