Detect and react to collisions

hello. how can I make my npc react to a collision? I have an NPC with a charactercontroller and animation. it also has a script that makes he wandering inside a circle. but he does not react to obstacles through walls, etc… how can I fix this?

Make sure you are using CharacterController.Move instead of dealing directly with Transform. It will take care of basic collisions.
If you want it to move around the obstacle, then you will need some kind of pathfinding algoritm (have a look)

I believe you will need to attach a kinematic rigid body to your NPC and handle it through OnTrigger.