How do I make an event pick any number in a variable or anything else?

0 favourites
  • 8 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • hey guys! (sorry for any grammatical problems) well, let me try to explain what I mean, my player object has 3 attack animations (attack1, attack2 and attack3) I want to make an event like "when finish animation-"attack"&(any number)" to every time the player finish an attack triggers the event

    any help will be appreciated S2

  • For this you can use &choose(1,2,3)

  • For this you can use &choose(1,2,3)

    I tried it, but it looks like it randomly chooses one of those numbers, I needed it to work with all the numbers. :/

  • Then you just create the events like you mentioned in the original post, if animation attack1 has finished, do something, what's the problem?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Then you just create the events like you mentioned in the original post, if animation attack1 has finished, do something, what's the problem?

    well, there are other animations that also have more than one variation, so there were a lot of events, but if that's the only way, this will be it.

  • You can right click an event to change it to an 'or' block.

    If animation a finished

    Or

    If animation b finished

    Or

    If animation c finished

    Do x

  • You can right click an event to change it to an 'or' block.

    If animation a finished

    Or

    If animation b finished

    Or

    If animation c finished

    Do x

    (sorry, I forgot to mention that I'm trying to make a combo for the player)

    hmm I think this is a good alternative (how did I not think of that?) well, I found a way to make an event that fits more into what I was looking for,I put a variable in the player to help:

    on "attack"&var finished

    add 1 to var

    so the event is now working on all animations

  • I think I can continue my project now, thanks a lot to you guys for taking your time to help me

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