Yesterday, I created a NPC using Wandering Steering Behavior and guis. If you haven’t seen it, then:
Today, I added Collision avoidance to this! Meaning this NPC is likely to not collide with any object that comes in its path. It either turns to the right or left, or turns around depending on safety circumstances and how close the npc is to the object.
Here’s how it turned out!
The red circle is the NPC. The white circle is the radius in which random targets to travel are chosen!
I achieved this using gui RayCasting! Its the not most accurate object avoidance method and tends to pass through walls sometimes, but works really well!
If you are wondering how I create lines using guis, its using Trigonometry!
Feedback is highly appreciated!