Skip to main content

InteractionCollisionController

A class in Root.Township, Alta.Character.

Makes a collider group ignore a pickup's colliders while an Interactor holds it.

Constructors​

MemberWhat it is
InteractionCollisionController()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private ColliderGroup collidersThe collider group that ignores held pickups.
private Interactor interactorThe interactor (hand) to watch.
private List<Collider> pickupCollidersColliders of the currently held pickup.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Subscribes to the interactor's start and end events.
private void InteractionEnded(Interactor interactor, Interactable interactable)Turns collision back on with the cached pickup colliders and clears the cache.
private void InteractionStarted(Interactor interactor, Interactable interactable)If the interactable is a pickup, caches its colliders and makes the group ignore them.