• Godot Help
  • How to Tween multiple properties in Godot 4?

In Godot 3, you could use interpolate_property() multiple times on one Tween

But in Godot 4, you have to call set_trance() and set_ease(), does that mean you can't have two different ease types for the same tween? Does that mean you have to create a tween for each tween_property() that uses different ease/trans types?

  • JusTiCe8 replied to this.
  • davek I wouldn't say "you have to" cause set_ease and set_trans call may be up to us, I never tried yet without one I guess it would use default one then.

    Regarding your question, in Godot 4, I use tween this way (here for a growing/shrinking anim loop, only "scale" here but it could be two different properties):

    var tween = create_tween()
    tween.set_loops()
    tween.tween_property(self, "scale", Vector2(3.0,3.0), 1.0).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)
    tween.tween_property(self, "scale", Vector2(1.0,1.0), 1.5).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)
    tween.play()

    Nothing stop me for using many properties in succession for each call and different ease/trans for the same property. It's only make sense to have one line like:

    tween.tween_property(self, "scale", Vector2(1.0,1.0), 1.5).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)

    for each values we want to use, but I'm note sure what your asking make even any sense as ease and trans are related to a property change AFAIK, but I may be wrong.

    davek I wouldn't say "you have to" cause set_ease and set_trans call may be up to us, I never tried yet without one I guess it would use default one then.

    Regarding your question, in Godot 4, I use tween this way (here for a growing/shrinking anim loop, only "scale" here but it could be two different properties):

    var tween = create_tween()
    tween.set_loops()
    tween.tween_property(self, "scale", Vector2(3.0,3.0), 1.0).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)
    tween.tween_property(self, "scale", Vector2(1.0,1.0), 1.5).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)
    tween.play()

    Nothing stop me for using many properties in succession for each call and different ease/trans for the same property. It's only make sense to have one line like:

    tween.tween_property(self, "scale", Vector2(1.0,1.0), 1.5).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)

    for each values we want to use, but I'm note sure what your asking make even any sense as ease and trans are related to a property change AFAIK, but I may be wrong.

      JusTiCe8

      Ah I didn't know they could be chained like that.
      I'll try it to see if it works, thanks

      8 months later

      As mentioned, JusTiCe8 answer allows you to tween multiple properties in sequence, in case you want to tween in parallel like in Godot 3, you have to use parallel(), so something like:

      var tween = create_tween()
      tween.set_loops()
      tween.parallel().tween_property(self, "scale", Vector2(3.0,3.0), 1.0).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)
      tween.parallel().tween_property(self, "scale", Vector2(1.0,1.0), 1.5).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_SINE)
      tween.play()