How do I use the Tween behavior?

0 favourites
  • 3 posts
From the Asset Store
Calculate parabolic trajectories and tween objects over them.
  • I am tryinan obg to resize ject in 8 seconds but i don't know how to use the tween i only know how to use the lite tween version for C2. The problem is that i am not able to start it...Can i have an example?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How do you want the tweening to start? It needs to have a proper one-time trigger, so if you have something like a system comparison (when a variable = X number or something like that), it won't work.

    A simple workaround is to set a function. You say:

    - system compare VAR = number >

    > call function "TweenStart" (sprite.UID)

    - On "TweenStart" >

    - pick Sprite by UID = function.param(0)

    > Tween one property (size or scale, I don't remember) in 8 seconds

    It needn't be a variable check. Anything that you need to start the scaling and is not a trigger, call a function in between :p to make it a trigger.

    In case you have more than one instance, then you will need to pass its UID as a parameter to the function to retrieve it and pick the right one at tweening.

    Maybe it is not your case, but I run into a similar issue these days when switching from old C2 Rex MoveTo to new shiny built-in Tween. Sprites didn't start moving at all. And then noticed this.

  • I am tryin obg to resize ject in 8 seconds but i don't know how to use the tween i only know how to use the lite tween version for C2. The problem is that i am not able to start it...Can i have an example?

    Im actually working on a little tween tutorial , not many out there for the tween behavior for C3.

    But its not done yet, for now, add 2 sprites and a keyboard plugin, call 1 TWEEN and 1 of them POSITION.

    Add the tween behavior to the tween sprite, now this is just an example, put the position sprite on a position you want on the screen.

    Now go to events, now this is up to you how you want to experiment with the tween object, add a on key pressed "x" then

    choose tween sprite, now its up to you how you want it, try the "two properties" tween, there you can set the speed and the type of movement (position,scale etc) .. We will set it to position and we will set the position to our sprite "position.x" and "position.y" , this makes it so that when we press X on our keyboard, the tween will execute its properties and move to the sprite named position. And you can experiment on how it will move in out elastic etc...

    Also on start of layout you can change the playback rates of your tweens.

    I will try to finish the picture tutorial today, you can PM me if you need any help!

    EDIT: Litetween does not work with c3 runtime, only c2. tween does work with c3.

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