How do I make a everytick function to a single object

0 favourites
  • 11 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello there! I have one question...

    I have 1 object (Sprite) with 3 instances. I want to make a function (or anything like) that have a code animation, not sprite animation. For example:

    Die animation:

    When an object dies, i want to make an animation with his death to that instace. How do i do it? Can i bind an object to an evertick function (or anything like)?

  • What triggers the death animation? If it is an instance variable for health reaching 0 then the event 'object health=0 - trigger death animation' will work for each instance.

  • What triggers the death animation? If it is an instance variable for health reaching 0 then the event 'object health=0 - trigger death animation' will work for each instance.

    But, it is a trigger, it will execute one time... i need to execute evertick (60 frames per seconds) got it? Becouse the animation is in code, not the sprite animation.

  • Most events trigger every tick without you having to change anything. I'm not sure what a 'code animation' is so I'll let someone else follow this up. It's probably easy to do I just don't understand what you want.

  • Most events trigger every tick without you having to change anything. I'm not sure what a 'code animation' is so I'll let someone else follow this up. It's probably easy to do I just don't understand what you want.

    Okay, let me explain it. I'm make a "lerp" animation with moviment. If i use a trigger, the "lerp" function will not execute... I need to evertick. Got it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe something like: Add another Variable, start it at 0, call it "Timer", set the death condition to: health<0 and Timer<60 -> your code stuff, plus add 1 to "Timer".

    On Timer=60, destroy object.

  • Maybe something like: Add another Variable, start it at 0, call it "Timer", set the death condition to: health<0 and Timer<60 -> your code stuff, plus add 1 to "Timer".

    On Timer=60, destroy object.

    Good idea, i will try. Some one have another idea?

  • When i use a lerp, i usually do it with a timer combined with a boolean.

    This way i can restrain the lerp and i know when it ended. By instance.

    https://www.dropbox.com/s/sa8g4v7lkj08s ... .capx?dl=0

    Cube is a lerp with 4 points. Nothing new.

  • When i use a lerp, i usually do it with a timer combined with a boolean.

    This way i can restrain the lerp and i know when it ended. By instance.

    https://www.dropbox.com/s/sa8g4v7lkj08s ... .capx?dl=0

    Cube is a lerp with 4 points. Nothing new.

    Cool, but it will work if one object have many instances?

  • Of course, timers are personal. That is the point. Boolean's are personal too.

  • Of course, timers are personal. That is the point. Boolean's are personal too.

    Thank you!

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