Using Tween.js for Simple Animations




  • Avatar


    I'm trying this solution to create simple animation, but following your tuto, I get an error in the console. What did I miss? 

    Thank you

  • Avatar
    Travis Chen

    Hi Keven, I suspect you didn't add the Tween.JS script to your scene. 

    • Create a new empty object
    • Add a script component
    • Add Tween.JS to the script component
    • Select initialized from the event dropdown

    If it still happens, it might be an order of operations problem. Trying moving the script you're trying to use Tween.JS with to the event "Lens Turned On" which happens after Initialized. This will let Tween.JS initialize and be ready to use prior to you using it. 

  • Avatar

    Well, I did have the script in my scene, but it seems I did not name it correctly, now that I have deleted the previous object and create a new one with the proper name, it's working. 

    Thank you. 

    Time to figure out, how to tweak to do what I want, which is creating a baseball bat movement. 

Please sign in to leave a comment.