ANIMATE LIKE A PRO with DOTWEEN | Unity Plugin Review

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
are you tired of spending hours writing complicated animation scripts in unity saying goodbye to those days and say hello to do twin in this tutorial I'm going to show you how to get started with the twin compare it with unity's built-in animation tools discuss how to Twin speed UPS the process and demonstrate examples and advanced features it offers so let's begin when it comes to animating game objects in unity there are two main approaches using unity's built-in animation system or creating them through scripting unity's built-in animation system allows developers to create game frame based animations for game object including translation rotation and scaling while this works well for character animation it may not be the most efficient option for non-character animation let's highlight its disadvantages limited control the system is suitable for simple animations but creating complex sequences becomes challenging Prestige changes and runtime modifications are difficult to achieve not programmer friendly in the building animation system is more suitable for artists or designers than programmers making modification challenging and time consuming lack of flexibility in the system has limited flexibility in making it difficult to create custom or unique animation that don't follow a linear path or are affected by user input considering these drawbacks it's worth exploring alternative methods of creating animation in unity through the use of scripts scripting provides developers with greater control flexibility efficiency and Precision in creating animations making it a powerful tool in game and application development however it's worth noting that creating scripts for animations from scratch can also be a time-consuming process but don't worry there is a solution that can make your life easier to twin this valuable assets should be in every Unity developers toolbox as it simplifies the animating process and saves your time the twin is a fantastic animation engine for Unity and that enables you to create twins sequences and animations effortlessly it's user-friendly incredibly flexible and perfect for all sort of non-character Animation from basic twins to complex sequences you'll be animating Lakey Pro in no time to kick things off with the twin download and import the plugin from the unity success store once this done open the twin utility panel and hit that set up the twin button no need to stress about those cheeks boxes for now the if all settings will do just fine the plugin will automatically import all the necessary sub packages into your project and voila you're all set to start crafting your animations now there are two ways to get jiggy with the twin editor components or scripting each method has its pros and cons which I'll showcase you with some examples the twin animation component offers a simpler and more user-friendly approach even though they still got some scripting managing going on behind the scenes this approach is really useful when creating simple animations or when you want to quickly see results using the preview feature let me demonstrate the perks of this approach with the UI animation example here we have a screen with a button that opens a setting pop-up but alas it lacks any animation and looks quite dual fear not we'll just end up with a sneezer appear animation a collect the pop-up game object and attaches the twin animation component it might seem complex at first but you'll get used to the visual interface quickly begin module using the animation time the twin provides a wide range of twins such as scale rotate fade and More in our case we need to select the move type additional parameter will then appear start by setting up the animation positions the twin includes a vector parameter next to the tool button adjust the X position to see the pop-up move from its initial position to the vector position you applied however we require the reverse movement so click on the tool button to modify Its Behavior now we'll apply the from position causing the pop-up to move from the specified parameter position back to its initial position fantastic now drag the game object beyond the screen balance to find the vector values copy the X position and paste it into the Twin now you are all set to preview your first between animation with the twin animation component it's a breeze just hit the play button and the animation will begin there you go it works to make the pop-up move faster adjust the duration next add the scale animation to the pop-up the select uniform scale to configure each axis separately and find suitable values press play to see the results if the animation seems too slow reduce the duration and add some delay to synchronized scaling with movement press play all to run all animations together it's looking good but we can enhance it further by modifying the East parameter animation is is the smoothness of motion it affects how fast or slow an object moves and how it accelerates or decelerates making your animation look more natural and realistic the Outback is pursed perfectly with our pop-up appear animation creating an engaging physical effect if we deactivate the pop-up game object and test the animation we find that it only placed once and doesn't repeat what's called in this to resolve the issue at the manager and select the pulling system preset lastly disable after play and after kill as the manager Now controls the animation life cycle awesome our pop-up appear animation is complete and looking great I use this approach when I need to achieve quick results but it might not be the best choice for a larger project that depends on more organization and control over animations that's why I introduced the scripting approach which developers tends to use more often picture this around the army of dancing Orcs And a powerful manganel launching pumpkin into them sounds like a fun and chaotic scene right well and with the help of the twin components you can bring this to life in your game our animation involves two actions the movement of the manganil arm and the projectiles trajectory movement stop the first action will attach the banking object as a child of the mangonil arm so they move together next we'll create a Mongolian script that implements this animation using do twin to activate the animation we'll insert an update method in the checks if the space key is pressed if it is the launch projectile method will be called we'll also add a reference to the arm transform so we can control it directly from the script now we are ready to add the first the twin script that rotates our mangonil arm we can invoke the twin methods directly from the components that should be animated so will right arm transform do local rotate to rotate the arm using its local rotation within the parent The Meta takes two parameters Target rotation and duration which will Define a serialized field to have more control over them back in the editor we'll select the arm and find good values for the final rotations tail we'll copy and paste the x-axis rotation to the manganel component and change the duration to 0.4 Run the game in the editor and press the space button awesome notice only one line of code and animation start working perfectly now let's move on the second part which involves launching the pumpkin projectile we'll need to create a second script called projectile that will contain the launch method the launch method will need two parameters a Target Point Vector that will Define the projectile's destination and align shade that controls how high the projectile raises to implement this in manganel script we'll use another useful feature of the twin name delay call this allows you to invoke an action with a specified delay We'll add a launch delay sterilized field and expression body method as a callback that will invoke the projectile launch function after the defined delay will also create two additional serialized Fields a Target Point transform and a launch hate we'll take the position from our transform and pass it to the projectiles launch method as a vector parameter and the launch hit will be the second parameter in unity we'll need to configure the values to be added first we'll select the pumpkin game object and add the projectile component then we'll link the projectile inside the manganel script next we'll create a Target point game object and place it in the middle of the crowd we'll link it to the manganel component as the target Point transform finally we'll set the launch hit to 10 and the delay to 0.2 let's check if the animation is working unfortunately it's not working yet because we haven't added any logic inside the launch projectile method so let's do that first we need to change the parent of the projectile so that we can move it separately from the mangonil arm once we've done that we can finally add the animation part the twin provides a great method called do Jam that will move the object to the end value with a defined directory using the jump power parameter the jump power parameter defines the heat of the territory to use the jump We'll add the target Point as an end value the launch hit as jump power and set the number of jumps to 1 will also add a separate field for the animation duration so we can control the projectile speed directly from its component now let's open unity and check the results amazing our pumpkin launches right into the army as you can see doing animations with is a quick process and you can achieve good results with a small amount of code I'm super excited to share my first ever YouTube video with you if you like it please subscribe to my channel and give this video a thumbs up your support is highly appreciated and will help me create more content for you cheers
Info
Channel: TapHub Games
Views: 8,200
Rating: undefined out of 5
Keywords: Unity, game development, DoTween, plugin, tutorial, animation, engine, tweens, sequences, easing, loops, callbacks, unity animation, how to create animation in unity, animation creation in unity, animation plugin, animation in unity, animate objects in unity, unity create animation, unity object animation, game animation, unity animation tutorial, animation tutorial, animation sequence, unity engine, unity tutorials, dotween tutorial
Id: rwjhXCmXyO0
Channel Id: undefined
Length: 9min 50sec (590 seconds)
Published: Sun Apr 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.