Updating the Collider Box
-
Prerequisite
Introduction
As described in Detecting Collision, you can use a collider box and some light rays to detect collisions. Sometimes, you will need to update the collider box, using the following block.
The “Update Collider” Block
You can set some additional parameters for the collider using this block:
Collider Dimension X/Y/Z
By default, the collider is sized to cover the player object exactly. However, you can change its size based on your needs.
For example, if you want the collider box to be extra thick, you can update the “Y” size.
Collider Z Offset
You can also set a different Z offset for the collider box. For example, if your avatar is running a swimming animation, then you need to update both its collider box dimension and Z offset.
Sensing Range X/Y/Z
These 3 inputs allow you to set the length of the rays in these 3 directions. For example, if your avatar is never going to move sideways, then you can set the collider in the X direction to 0, so no collision will need to be checked in that direction to reduce some computation time.
Collider Box Color
Lastly, you can use a different color for the collider box, if the yellow color does not provide a great contrast.
-