[Resolved] Pick object using instance variables

Get help using Construct 2

Post » Sun Feb 17, 2013 9:32 pm

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?ome6a17172013-02-18 07:46:24
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Mon Feb 18, 2013 6:52 am

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?
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Mon Feb 18, 2013 7:03 am

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?
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Feb 18, 2013 7:46 am

You're right - I can't believe I missed this. You can't use a function while utilizing instance variables :).

Much appreciated!
B
22
S
3
Posts: 451
Reputation: 2,135


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Zebbi and 23 guests