Please help my function.

  • Please help my function.

    I have picked the nearest sprite.

    but the picked is not worked.

    all sprite would call the function even it isn't on picked.

    very thanks.

    Plus:

    If not use function.

    each made the same code.

    it would work well.

    i dont know what is the problem about function.

    very thanks.

  • Hiya it's because when you run the function there is no longer a sprite picked, it then applies it to all sprites. You need to pass the picked sprite data through the function as a parameter, you could try something as simple as setting sprite.UID as the parameter in event 44, then in event 39 when you call the function, put in a compare condition if sprite.UID = function.param(0).

  • Hiya it's because when you run the function there is no longer a sprite picked, it then applies it to all sprites. You need to pass the picked sprite data through the function as a parameter, you could try something as simple as setting sprite.UID as the parameter in event 44, then in event 39 when you call the function, put in a compare condition if sprite.UID = function.param(0).

    it worked!

    Thanks for your help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Awesome!

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