Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 3D Blocks
  4. Updating the Collider Box

Updating the Collider Box

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 882 Views
  • 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.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

     

    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:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/0ffedb82-38cc-419d-a463-ccb564a12246.png" width="900" style="">

     

    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.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/50852149-83a5-4e2b-a56e-b755a5ea05d0.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">

     

    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.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/f5f6da1a-71a7-4bba-81b5-f7383e54b6e2.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">

     

    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.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/72949f58-1a0e-4811-935e-8257819befb4.gif" width="700" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Collider Box Color

    Lastly, you can use a different color for the collider box, if the yellow color does not provide a great contrast.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/043faf6e-3a75-4b20-bd1a-a3c833925984.gif" width="700" style="border-radius: 5px; border: 1px solid #29622d;">

    1 Reply Last reply
    0
    • CreatiCodeI CreatiCode pinned this topic on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode