How do I

0 favourites
  • 12 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • I need this: when i click on object and this object is animation for example "animation5" then i want to change her animation to animation1 and change animation of another instance of this object (only one instance) to animation2 and change animation of another instance of this object to animation3, when is playing animtion2... Do you understand? I really do not know how to do it... please help me

  • It's a question of picking..

    You can pick by comparison or by evaluate or random or pick all

    so on object clicked

    if object.animation = 3 - set animation to 1

    system pick all objects

    system pick random object - set animation to 2

    well something like that, but it would be much easier if you were a bit clearer on what you want..

    Should the animationchange be random, should the objects picked be random, how many objects should change animation, are the animations multiframe or could you just use one animation with frames, etcetera..

  • It's a question of picking..

    You can pick by comparison or by evaluate or random or pick all

    so on object clicked

    if object.animation = 3 - set animation to 1

    system pick all objects

    system pick random object - set animation to 2

    well something like that, but it would be much easier if you were a bit clearer on what you want..

    Should the animationchange be random, should the objects picked be random, how many objects should change animation, are the animations multiframe or could you just use one animation with frames, etcetera..

    It is not so easy, i tried this too, but it doeas not work...

  • Like I said, It would be much easier if you were a bit clearer on what you want..

    I guess it would be as easy as creating a function which can be used on any object clicked, but I haven't seen your events and or capx so it's like shooting in the dark..

    Please share your capx, or create a new capx showing the issue, or make a screenshot of your events, so it is possible to see where the problem is..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Raiper341

    I'm assuming you have an object with 5 animations that you want to cycle through when the object is touched. That is, when touched you go to the next animation and when it's on the last animation you go back to the first one.

    Here is an example of how to do it:

    [attachment=0:1u3y9y6c][/attachment:1u3y9y6c]

  • Like I said, It would be much easier if you were a bit clearer on what you want..

    I guess it would be as easy as creating a function which can be used on any object clicked, but I haven't seen your events and or capx so it's like shooting in the dark..

    Please share your capx, or create a new capx showing the issue, or make a screenshot of your events, so it is possible to see where the problem is..

    Here is picture of my latest try: https://www.dropbox.com/s/lq0l3jhqiane3 ... .21.00.png

    But this change all instances to animation1....

  • Raiper341

    I'm assuming you have an object with 5 animations that you want to cycle through when the object is touched. That is, when touched you go to the next animation and when it's on the last animation you go back to the first one.

    Here is an example of how to do it:

    [attachment=0:udc8t99s][/attachment:udc8t99s]

    Panda thx, but i need when you click on instance with animation5 set random instance with animation1 to animation2, then another instance with animation2 set to animation3 ... I need affet next 3 objects for example. And this does not work for me

  • Ok..

    I immediately notice 16 clones of the ghost object, which I don't understand..

    They are probably all in the ghosts family, but wouldn't it be much easier just to use copies instead of clones?

    Than you could pick random ghost instance instead of random family instance..

    I would set the animation to "e"&ghost.instancevariable and just repeat picking a random instance 5 times and changing the variable to ghost.instancevariable+1 and setting the animation to "e"&ghost.instancevariable..

    Maybe adding a boolean to make sure instances aren't picked twice during the repeat..

  • By the way, putting this in a function would even be more convenient..

  • Ok..

    I immediately notice 16 clones of the ghost object, which I don't understand..

    They are probably all in the ghosts family, but wouldn't it be much easier just to use copies instead of clones?

    Than you could pick random ghost instance instead of random family instance..

    I would set the animation to "e"&ghost.instancevariable and just repeat picking a random instance 5 times and changing the variable to ghost.instancevariable+1 and setting the animation to "e"&ghost.instancevariable..

    Maybe adding a boolean to make sure instances aren't picked twice during the repeat..

    But how to use bolean? I do not know, maybe this is the problem...

  • something like this:

    set the boolean to true in the same event you set the animation..

    pick (random) instance with the condition that boolean is false

    after all animations are changed the way you'd like reset allbooleans to true..

  • something like this:

    set the boolean to true in the same event you set the animation..

    pick (random) instance with the condition that boolean is false

    after all animations are changed the way you'd like reset allbooleans to true..

    It still does not work for me I really do not know how to make working...

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