How to NOT edit all instances of an object?

0 favourites
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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

  • you eather have to make a new Object(clone) or go back and disable the behavior on your other sprites after you add it

  • but how do I disable behaviour of 1 object but still wanna keep it on the other instances?

  • 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.

  • 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

  • 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?

  • 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 ?

  • 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 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.

  • 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.

  • 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

  • Yeah, if you first click the object in the project tree on the right, then go changing things in behavior properties, they will be applied to all the objects. Also newly created.

    When you put an instance on the layout, and click that first, and then change properties, you will change the properties for that object instance in the layout. And newly created objects will have the ones from the default values in the project tree.

    You can double check, because, after you give one instance a new value in the layout, then click the same object again in the project tree, you will notice the property has gone blank, indicating at least one instances exist with varying values.

    would you now change the behavior value from the one in the project tree, the ones in the layout will receive the same value ...

  • thx, but this somehow doesnt work for me. I drag and drop a new object from the object tree into the layout -> new instance. I change the properties of this instance and it also changes automatically the ones in the object tree :/

  • thx, but this somehow doesnt work for me. I drag and drop a new object from the object tree into the layout -> new instance. I change the properties of this instance and it also changes automatically the ones in the object tree :/

    When you drag from the project tree ... the selection is still in the project tree ....

    click in the layout somewhere (not the object) then click the object ..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i did that..it doesnt work lol..do you mind uploading a test project where the setup is correct? i really dont know why it doesnt work for me

  • You can try this:

    1. disable the bullet behavior for your object in the editor (Initial State: Disabled)

    2. give the object an instance bool variable (for example call it isMoving and set to true)

    3. create the objects you don't want to move and set their isMoving variable to false

    4. in a for each loop check all your objects and set the bullet behavior enabled for every object,

    with the isMoving bool variable set to true

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