How do I inherit parameters when an object is spawned?

0 favourites
  • 5 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • I make sprite "bBlock". Object of this type should create the same object, when the value of the variable reaches a certain level. And I want the value of the variable of the created object to depend on the value of the variable of the object that triggered the event.

    But I can't figure out how to do this :-(

    Give me some advice, please

  • Show the event of the triggering object or are you saying bblock makes a bblock spawn? And what variable?

  • "bBlock" has instance variable "bHit"

    When the value of the variable "bHit" is greater than or equal to 10, the following should happen:

    1. The value of the variable "bHit" should decrease by half (I know how to do this)

    2. The new object "bBlock" should appear (I know how to do this)

    3. Set the value of the variable "bHit" of the new object "bBlock" equal to the value of the variable "bHit" of the object that triggered the event (I dont know how to do this)

  • Ok well it's a little more complicated because the objects are the same, if they were different it would be a simple set object B var to objectA.var.

    Here are two ways I tried using a function to set the var or by setting it 'on object created' with a global variable.

    Note the second way has an extra variable spawnnew because if you don't have this it will also assign the variable to the blocks created on start of layout and you probably don't want this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the advice. I managed to do this using local variables in the event list.

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