Feedback on Smart NPC - Collision Avoidance

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!

6 Likes

Hey there. It’s really pretty well made. One question though.

How on earth do you get 2d raycasts?

I have never seen any raycasts like that ever. Did you make your own module for it?

Yep, I made my own! Here’s the link if you want it: https://www.roblox.com/catalog/7302354349/RayCast2

2 Likes