- Home /
              This question was 
             closed Feb 22 at 04:27 PM by 
             ZeroIQ_Scripter for the following reason: 
             
 
            Problem is not reproducible or outdated
 
               Question by 
               ZeroIQ_Scripter · Mar 20, 2020 at 03:19 PM · 
                c#scripting problemscript.navmeshnavmeshagent  
              
 
              Make NavMesh move to random positions
I want to make NavMesh move to random Positions.
               Comment
              
 
               
              Answer by RageEye · Mar 20, 2020 at 09:22 PM
 Vector3 finalPosition;
 
 Vector3 randomDirection = Random.insideUnitSphere * walkRadius;
 
  randomDirection += transform.position;
  NavMeshHit hit;
  NavMesh.SamplePosition(randomDirection, out hit, walkRadius, 1);
  finalPosition = hit.position;
 
 (I found this on another question)
Follow this Question
Related Questions
How can i make my soldier to patrol over the space station in random ? 1 Answer
Unity Navmesh agent patrol and chase player script issues. 0 Answers
Is it right to turn false both navmeshagent updateRotation and updatePosition properties ? 0 Answers
How can i use a button key click to switch/toggle between enum options ? 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
               
 
			 
                