How to flash the instance on the parent with the child together?

0 favourites
  • 9 posts
From the Asset Store
A collection of 10 amazing sprite sheet animations for your incredible games
  • Hi! I'm new here, so I'm not sure how to explain my problem here, but I will try something.

    I'm trying for at least 1 hour to use the flash behaviour on my enemy ship (parent) with his canon at the same time (child).

    ----------------------------

    Expected behaviour:

    When the player's bullet hit the enemy ship and this one has more than 1 life point left, flashing both the enemy ship and his weapon for 2 seconds.

    ----------

    Unwanted behaviour:

    Instead, only the enemy ship is flashing without affecting his child.

    ---------------------------

    Any help will be welcome ^^

  • I think you are missing Picking the Childs as I couldn't see it in your events.

    I think you are referring to event 14

    So what you do is:

    Bullet On collision with Ship:

    Is not flashing:

    Enemylife > 1

    Subevent: Ship Pick Childs >>>> Flash (Childs & Parent)

    This is assuming you add the child to his parents through Hierarchy

    You could use containers though so you don't have to pick them again the childs as they pick automatically with the parent

  • It's working :D

    I never knew the utility of sub-event ^^

    Now, this is not the issue of this post title, but since I added the enemy canon has a child to the enemy ship, the turret is not getting the player as a target, like if they can't be enabled.

    Here is the project file:

    drive.google.com/file/d/10Ttg0vMNoH8CKqUd5xr_XJc9zn6lzGc-/view

    Do you think the turret behaviour is not compatible with the parent/child hierarchy?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the turret is not getting the player as a target, like if they can't be enabled.

    It works for me, you can test it out by Putting the Turrent Range higher like 600/700 and see all the turrets target the player.

    Another thing you don't need to use containers if you already use Hierarchy, the purpose of the containers is to pick them together but you already use Parent Pick Own childs.

  • First, my turret range was already 900 from the start, so idk how you get lower than that in my c3p file.

    Second, removing the container doesn't help.

    With the container:

    --------------------------

    If I remove the container:

    Idk what is wrong with the container if I already have a parent/child since the container prevents the child to not getting spawned.

  • First, my turret range was already 900 from the start, so idk how you get lower than that in my c3p file.

    You don't have any instance of the Cannon on the layout and both when they get spawned it shows me (Range = 300) you can check it out on the Debugger

    Second, removing the container doesn't help.

    If I remove the container:

    Remove the container and use the Hierarchy as you do now add them as a child but you still have to spawn the Childs manually and position them into their Parents then is when you add them as a child "on this order"

    1-Parent on Created: Spawn childs

    2-Add them as childs

    3-Set their Turret range to more than 300

  • Everything is working now :)

    Thank you a lot.

    I thought by using add child, the canon would be spawned with all the parameters I put before removing it. I thought Construct 3 was working as "saving all behaviour parameters through the whole project even after if I delete it from the layout".

    I'm using Construct 3 as the main game engine after a jump of years from GameMaker, so I was, and still am, confused about everything about how to use Construct 3.

    I think it will be better if I check some Construct 3 tutorial 101 for new users :)

    Thanks again for the help and have a nice night ^^

    (Little note: Are my file names good (a_info, enemy_ship, etc)? Still using the GameMaker file names tho).

  • Np Glad was helpful

    What happened is that you had them in a container so when you put them in a container:

    1-If you create one object from the container then it will create all the objects inside the container

    2-The same when you delete one object it will delete all the objects inside the container

    3-The same when you pick one object it will pick all the objects inside the container

    The Hierarchy is a bit different:

    1-You always need to pick the child or parent

    2-You have more control over if you want to spawn the Hierarchy or not so you are not locked as the containers do, you have more freedom.

    If you like to spawn the children with the parent you can create the Hierarchy in the editor then when you create the Parent you have an option to spawn the Hierarchy.

    -The object naming is good I do the same

    -The layout however I will do it differently as just the Letters at the beginning it will make my brain think all the time what layout is this?? jeje

    So I normally do:

    Layouts:

    Menu

    info

    Game

    Credits

    EventSheet:

    Menu_E

    Info_E

    Game_E

    Credits_E

    But You follow what you like and what is best for you as everyone has his own way and none is better than the other as long it makes your life easier.

  • Thanks for the info :)

    My brain right now:

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