0 Favourites

[Resolved] Pick object using instance variables

  • I've read every forum and tutorial I could find on the matter, but I cannot figure out how to pick specific instances of a single sprite object.

    I've created a variable instance called "Instance" for each object instance and set a specific number to each for recall. But when I do a command such as "If Sprite's "Instance" = 1, do this ; If Sprite's "Instance" = 2, do this", it does the same thing for all instances.

    Any idea why this is happening?

  • Just bumping this post - I've been trying different methods and nothing seems to be working. None of the other pick instance threads seem to cover this, either.

    The best way to put what I'm trying to achieve is to create a bunch of instances of 1 object and control them as if they were all separate objects (without having to make separate objects).

    Is this perhaps not possible?

  • If you set a variable for your sprite and set different name/number of that variable for all instances. You should be able to pick them using

    sprite variable = "something"

    If this does not work you ptobably made a mistake in your events or sprite variable names.

    If you could share a capx will be easier to see what's wrong?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You're right - I can't believe I missed this. You can't use a function while utilizing instance variables :).

    Much appreciated!

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