The first container seems to work differently from the others

0 favourites
  • 5 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • Hello people,

    I created a little system that make bugs walking with procedural-like animation for the legs. (a simple one : six points represents where the feets are touching the ground and each time the body, which is always in motion, moves away from these points by a certain distance, those points are teleported back at 6 imagepoints that are all around the body. And the legs are just stretching to connect the center of the body with these points)

    And i added a simple pathfinding behavior to the body so he's following a cross that teleport randomly at the screen regularly.

    Here is the main panel.

    Here is the line applied for all the points

    Here is the line applied for all the legs

    So i added all of those elements in a container so i can make appear many animals in the same times and they all use their own legs and all is great.

    (sorry for my bad english, by the way)

    So at the start it was working great.

    It look like this. (the point will be invisible at the end of course)

    But there are a weird thing that occur : when the original container; the one i placed first touch the cross, all the point for all the others containers stop moving, so their legs continue to stretch for no reason until the cross teleport again.

    The most weird thing is that this only occur when this beetle from the original container reaches his cross. when one of the other ones reaches their cross, nothing weird happend and all continue to work normally.

    Do anyone know why this weird asymmetry is happenning ? And why those objects that are in a container suddently start caring about what appened to another one container ? I'm looking again and again on the code lines and i don't understand what could cause this.

    I can upload the project if needed, but i dunno how to do it.

    Thank u

    Tagged:

  • You need to wrap events 23, 24, 30, 31 in "For each" loops.

    When there are multiple instances, expressions like distance() only work correctly for the first instance. Adding "For each thorax" or "For each patte" should fix the issue.

    If it doesn't help, please upload your project to any file sharing service and post the link here.

  • Thank you very much ! It work !

    That's the fist time that i use the containers and i have some trouble understanding how they works.

    Oh, i have just one another question : The crosses are supposed to teleport at random places at random time. The place is different for each cross, so this works, but they teleport all in the same time, do you know why ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The crosses are supposed to teleport at random places at random time. The place is different for each cross, so this works, but they teleport all in the same time, do you know why ?

    Because you are not picking a cross instance. When you don't pick any instances, then all instances will be affected. Try adding "System pick random cross" condition into event #3.

  • Thank you very much !

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