- Home /
The question is answered, right answer was accepted
Move player to specific location and avoid obstacle.
Hello,
I need to move a player to many different location each time( the route not aligned), and avoid the obstacle. i have try the code from this website : http://www.theappguruz.com/blog/unity-3d-enemy-obstacle-awarness-ai-code-sample
but the player does not avoid obstacle and in some time go in another long route to arrive to the target. should i use an algorithm for finding path?
Answer by Vivek-Joshi · Sep 22, 2015 at 06:40 AM
Have you tried using NavMesh?
Assign the NavMesh Agent to your Character - then you have to bake the scene. https://unity3d.com/learn/tutorials/modules/beginner/navigation/navmesh-agent Check this link.
For your help, dodging the obstacles, try this, https://unity3d.com/learn/tutorials/modules/beginner/navigation/navmesh-obstacles?playlist=17105
Hope this helps.
Answer by Araj-Tejani · Sep 28, 2015 at 06:30 AM
In this Code last four if condition will remove. Obstacle are remove it.
Follow this Question
Related Questions
Raycasting on Moving Colliders 0 Answers
Moving objects using raycasting? 1 Answer
changing itween moveTo speed param. 0 Answers
Making object found with raycast a child of the object the ray is cast from 1 Answer
Enemy AI passing through walls 1 Answer