Updating a tween every frame base on User Input
« on: April 22, 2015, 05:25:40 AM »
I was wondering what the best way to constantly update a tween would be. For example, I want to tween a space-ships rotation based on user input which can constantly change.

I'm not sure if DOTween would end up creating a ton of tweens for the same value, or if it would just overwrite the previous tween, but I figured it might be acceptable to just call transform.DoRotate() every frame.



  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Updating a tween every frame base on User Input
« Reply #1 on: April 22, 2015, 01:13:50 PM »

If you want to create a new tween every frame, you should store your tween as a variable, and be sure to kill the previous one before creating a new one (so that they don't "fight"). That said, creating a tween every frame kind of nullifies the usefulness of the tween itself, and I would actually recommend to use custom code to control stuff that is changed every frame.