SimpleMove Question

I am looking over the scripts in the 3d platformer tutorial and wanted to know if the below line is basically not moving the characterController.

characterController.SimpleMove(Vector3.zero)

If so, why call SimpleMove?

Perhaps to apply gravity, since SimpleMove applies it automatically, and to get the return value if the character is grounded.

If I wanted to make the enemy move randomly in a predefined circular area what would be the best way to do this?

I assume I would:

Create a game object to define the regoin the enemy can roam.

I would need to pick a randon point in this region and turn and simplemove the enemy in that direction, similar to the chase logic?

How would I make this gameobject accessable from within the enemy script? Would I cache a reference to this object in the enemyPoliceGuy.js like they do for the controller? If I made it a public variable then I could drag the reference in the inspector, correct?

Wow!

Too many questions for one post!

Let me try to answer what I can.

This could work. You could also check the functions Random.insideUnitCircle if the area to roam is circular. This might save you some time and the creation of that “dummy” object.

Yes, this is definitely an option.

Correct.

If I used Random.insideUnitCircle is there a way to show the circle using a gizmo in the editor?

In OnDrawGizmosSelected can I use Handles.DrawWireDisc or can i only use the gizmo class?

Check out Gizmos.DrawSphere