Categories
Virtual World Building

Llama Drama Dev Blog – Detection Bubble

The purpose of the detection bubble is to detect specific entities within a given radius around the llama. We originally wanted it to detect the player, any items thrown by the player, and items from the fabricator. With the cut back of items from the fabricator, and the continuous new problems with the state machine, the bubble only detects thrown items.

Detection Bubble

In the video above, you can see the bubble in effect due to the use of an editor script. The lines are visible in editing mode but disappear when running. You can set the radius of the bubble depending on how far you want to be able to detect objects. The yellow line is the angle of detection and can be changed from 0 to 360 degrees, opening outwards from the front of the object. Also, you can set objects to obstruct the bubble and act as a barrier to prevent detection, or just completely ignore objects by using layer masks.

Detection Script
Editor Script