How can I use Timeline for each instance ?

0 favourites
  • 3 posts
  • Hello everyone !

    I'm starting to be crazy by testing stuffs with the Timeline plugin ! xD

    I'm making a platform elevator using the Timeline plugin. So I duplicated a sprite and made a timeline track for each of them. The problem is when I trigger 1 sprite, the timeline is playing for all of them. I've even used the "set instance" action, still the same issue. What am I doing wrong ?

    Here is a c3p file example ⬇ (just click on the sprite to start the timeline)

    https://drive.google.com/file/d/1YT26cvhL54yATMk7Lli5SbDKK6G3lMJJ/view?usp=drive_link

    Thanks for your help ! :)

  • You have put all 4 movements in a timeline. If you want only the instances you click to move, you have to create a second timeline on the right, under timeline 1 there must be timeline 2 with the movements of only the instance that you want to move on click, and then you have to give a numeric variable to the sprite, and assign different numbers to the instances.

    The third line of code is enough to activate the timeline. On click if variable 2 -> play timeline 2

    if variable 1 -> play timeline 1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi UltraLion !

    Thank you very much for your help !

    I've found a solution thanks to your tips :

    - create an intance variable "timelineID"

    - create a timeline with the name of the sprite and the ID (exemple : "Platform_1")

    - create a custom action for the Sprite "Trigger platform"

    - On "Trigger platform" ➡ play the timeline by name : "Platform_"&Platform.timelineID

    Works perfectly ! I just have to organize my timelines into a folder named "Platforms" now. :)

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