Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

custom events for multiple game objects

Discussion in 'Visual Scripting' started by ChewyChipsAhoy, Sep 23, 2022.

  1. ChewyChipsAhoy

    ChewyChipsAhoy

    Joined:
    Aug 2, 2020
    Posts:
    1
    I made a game object button in my 2d scene that when pressed it would trigger a custom event inside the blocks to make all the blocks with the same tag reverse their gravity and float to the ceiling. I had it working before but don't know what i deleted because now it only reverses the gravity for the first one it finds. My head hurts trying to figure this out

    The picture is the flow chart for the button.
     

    Attached Files:

  2. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    woah what version of visual scripting are you using?
    also woah photograph of a screen haha nice

    do both objects have the tag "Block" ?
     
  3. racsogrong

    racsogrong

    Joined:
    Feb 16, 2021
    Posts:
    2
    This might be suitable for what you are doing. It works by finding all objects with the tag and triggers the custom event on each block individually. Screenshot 2022-09-28 075321.png
     
    REDACT3D_ likes this.