Skip to main content

Contacts... How Do They Work?

image-1646942815727.gifGive headpats to the shadow creature

In this semi-guide I'll explain how contacts work to my own limited understanding of them, great idea right?!

I recommend reading the official documentation for contacts for a more technical look at how they function! This page is just the utmost basics.

The Contact Receiver Component

image-1662169051741.png

I won't be going through every function of the component as the official documentation lists it all pretty clearly.

Collision Tags

This is where you choose what the contact receives signals from when touched by the corresponding contact. You can add pretty much as many as you want, including custom tags which are really cool! Those will be talked about in another page.

Reciever Type

There are three types of receiver types, Constant, OnEnter, and Proximity.

I may be slightly incorrect on some of these

Constant - When a sender (as determined by what is listed in collision tags) touches the reciever it'll change the value of a parameter. For Float values, it will be 1.0, for Bool values, it will be True, for Int values, it will be 1. It is recommended to use a Bool

OnEnter - When a sender touches the reciever, the value will reset on the next frame. For Float values, it will be 1.0, for Bool values, it will be True, for Int values, it will be 1. It is recommended to use a Bool. You can set a "Min Velocity" which dictates how fast that sender has to move to trigger the contact. It is recommended to use a Bool

Proximity - Gives a float value of 0.0-1.0 depending on how close a sender is to the center of the contact. When multiple senders touch the contact, it'll prioritize the closest sender.

Parameter

This is the parameter is updated when the reciever is touched by a sender. This can be used in your Animation Controllers to drive animations as you would with any other parameter.

These do not have to be listed in your expression parameters.