How do I change instance variable in same sprites when overlapping another object?

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi!

    On start of layout I create two the same sprites "Hero" (with DragDrop bahavior)

    with different instance variables:

    HeroID="Left" and HeroID="Right"

    Sprites "Hero" has one more instance variable: "Check"

    I need to change instance variable "Check" from the sprite "Hero" with instance variable HeroID="Left" when sprite "Hero" with instance variable

    HeroID="Right" is overlaping "SpriteOverlaping".

    If shorter...

    When "Hero" with HeroID="Right" is overlaping "SpriteOverlaping"

    I need to change instance variable "Check" from "Hero" with HeroID="Left"

    I can't solve this problem :) Need help :)

  • Use a function on the action. On the function add a parameter for the variable and send through the function the hero.ID (it picks the overlapping one automatically). Then in the function, if param=left pick hero where ID= right and set variable, if param=right pick hero where ID=left and set variable.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Use a function on the action. On the function add a parameter for the variable and send through the function the hero.ID (it picks the overlapping one automatically). Then in the function, if param=left pick hero where ID= right and set variable, if param=right pick hero where ID=left and set variable.

    Thanks a lot! It works! :)))

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)