How to NOT edit all instances of an object?

Get help using Construct 2

Post » Mon Mar 23, 2015 9:01 pm

Hello,

I would like to spawn several objects, which should have a certain behaviour. The problem is that i need to place instances of the same object I would like to use, else there will be an error. But I don't want the previous placed objects to have no behaviour at all. How do I solve this? Thank you
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Mon Mar 23, 2015 9:10 pm

you eather have to make a new Object(clone) or go back and disable the behavior on your other sprites after you add it
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Mon Mar 23, 2015 9:13 pm

but how do I disable behaviour of 1 object but still wanna keep it on the other instances?
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Mon Mar 23, 2015 9:25 pm

Pick the object.

you can use pick by UID, or something like pick all, pick by evaluate.

Also, directly after you create or spawn an object, when you set behavior properties, they will only be applied to that instance.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,542

Post » Mon Mar 23, 2015 9:30 pm

sorry read your question to fast didnt realize you want to spawn objects like this and arnt talking about just in editor. do as @lennaert says
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Mon Mar 23, 2015 9:35 pm

hm. When I select and change an instance it automatically changes the object aswell, I really dont understand how to have instances of the same type with different properties.

@lennaert: I don't exactly know what you mean :/ pick by UID?
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Mon Mar 23, 2015 10:08 pm

If you have the UID of an object, you can reference it with an action from the object options.

Otherwise, in system, there is the PICK option.

If you give the objects you want to change a variable to distinguish between them, you can use pick to select the ones you want.


event
pick all object
pick object by evaluate where object.var = X
action
do something with the picked objects.


Might I ask what it is you are trying to change ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,542

Post » Mon Mar 23, 2015 10:14 pm

I would like to to spawn different instances of an object on top of the screen. They all have the bullet behaviour, so they move towards the bottom. It works fine but the previous placed instance is moving aswell, but it shouldnt :P That is what i am trying to achieve.

And your picking solution doesnt help at all. Because if I give the object a variable then every instance hasit and I cant choose between single instances anymore.
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Mon Mar 23, 2015 10:23 pm

It looks to me like you are editing the object in the project tree.

That would indeed apply to all instances.


In the event sheet, when you create or spawn an object, directly after that action, if you set values for behavior, they will be applied to that object you just created.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,542

Post » Mon Mar 23, 2015 10:29 pm

Yes that must be it I think but it isn't I guess? ^^ prntscr(dot)com/6kjjdz i cant post screenshots yet so just replace the (dot) with a "."

On the right side there is the object tree panel. On the left side there is an instance of "RedSq", I click on that instance and change the behavious and if I click on the "RedSq" in the rightside, it changed aswell~

What am I missing here? lol
B
12
S
3
Posts: 211
Reputation: 1,477

Next

Return to How do I....?

Who is online

Users browsing this forum: conker23, Janaina, LaurenceBedford, lucaralho, morgandood and 5 guests