Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Updating the Collider Box

    3D Blocks
    1
    1
    307
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

       

      Prerequisite

      • Detecting Collision

       

      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.

      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post