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. 2D Blocks
  4. The "When touching (object)" Block

The "When touching (object)" Block

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 1.5k 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

    • Working with Blocks

     

    Description

    The “When touching (object)” block is a Hat block in the events category.


     

    How does this block work?

    This block plays the blocks attached below it when the current sprite touches another object, such as the “mouse-pointer”, the “edge” of the stage, or any other “sprite”.

    You can select from these 3 options by clicking on the drop-down menu.
     

    When touching (mouse-pointer)

    If you select “mouse-pointer” as the target object, this block will play the blocks attached below it whenever the mouse-pointer touches the current sprite.

    As shown in the example below, whenever the mouse-pointer (cursor) touches the jellyfish, it says “Hello”.


     

    When touching (edge)

    If you select “edge” as the target object, blocks below this block will play whenever the current sprite touches any of the 4 edges of the stage.

    For example, as shown below, whenever the jellyfish touches the edge of the stage (highlighted in red in this example), it changes the costume.


     

    When touching (sprite)

    If you select any other “sprite” as the target object, the blocks below will play whenever the current sprite touches the target sprite selected.

    As in the example below, whenever the jellyfish (current sprite) touches the fish (selected target sprite), it increases in size.

    Note: You need to have at least two sprites in the project before you can select another sprite from the drop-down list.


     

    1 Reply Last reply
    0

    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