- Home /
Implementing wander mode
Hi,
I need help implementing a wander mode function were a gameobject wanders randomly within a specified distance from spawn.
Right now I'm able to check distance from spawn but I cannot seem to make the gameobject wander randomly from point to point within that area.
Both of the methods here will work for you. For the first walk segment one, you repeatedly generate points for the next walk position until your next point falls within the appropriate distance from spawn point For the second one, each point in the path may be generated by:
randomPoint = spawnPoint + Random.insideUnitCircle * maxDistance;
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How can i make the ray cast don't go through the walls 1 Answer
Boxcollider 2D Destroyed 2 Answers
Multi-Touch help 1 Answer
Need help to understand code! 1 Answer