Adding some squash and stretch to your GameObjects can really make them come alive. All you need is a bit of code in Unity! Let's learn how!
This script can be attached to 3D objects, 2D sprites and UI elements without any changes needed. It's highly customizable and offers features like forward and backwards playing of the animation, percentage based animation (30% chance to play, for example) and a way to have every element react at once without having to find all the elements in the scene.
Three use cases show exemplary implementations: UI Buttons reacting to hovering above them, 3D elements's squash and stretch being called when they get created and a 2D character with a breathing animation as well as a jumping and landing animation.
📃 Github
https://github.com/Maraakis/Christina...
Assets I used for this:
Kenney - Scribble Platformer - https://kenney.nl/assets/scribble-pla... (free)
KayKit - Halloween Bits - https://kaylousberg.itch.io/halloween... (free with paid extras)
KayKit - City Builder Bits - https://kaylousberg.itch.io/city-buil... (free with paid extras)
Both make amazing game assets, check them out =)!
Note about Odin Inspector:
I've used a few Odin Inspector Attributes in this video, but you don't need any of those to follow along. I just realized there are a lot of people out there with the asset sitting around, not finding good, every-day use cases yet 😉
Odin Offers a 90 day free trial in case you got curious 💛 You can find it here: https://odininspector.com/download
And in case you think it's worth it, here you can find it on the asset store: https://assetstore.unity.com/packages... [Affilate link]
💬 Discord 💛
You are very welcome to join!
/ discord
🛍️ Store links 🛍️
If you'd like to support my channel, consider using my affiliate link when buying cool stuff in the Unity asset store: https://assetstore.unity.com/?aid=110... [Affilate link]
Synty Store: https://syntystore.com/mh/christina [affiliate]
🌟 Need help with your project's UI?🧠
I have been a designer for more than 15 years, a teacher for three and I offer paid consulting for your project! You can find all the information here:
https://www.vennegerts.com/gamedevelo...
I am looking forward to hearing from you 💛
🎮 Play my games on Itch.io 🎮
https://christinacreatesgames.itch.io
📖 Chapters 🔖
00:00 - Introduction
00:30 - The Effect of Squash and Stretch
01:33 - Writing the Script
02:09 - Core Settings
03:35 - Animation Duration and Settings
05:13 - Looping Settings
06:30 - Initial Scale and Animation Curve
08:00 - Looping and Delay
09:08 - Axis Effects
11:00 - Reverse Animation
11:30 - Percentage Chance and Animation Play
12:00 - Squash and Stretch All Objects
13:24 - Examples: UI
13:51 - Examples: 3D
14:08 - Examples: 2D Character
14:37 - Conclusion
💬 Discord 💛
You are very welcome to join!
/ discord
🛍️ Store links 🛍️
If you'd like to support my channel, consider using my affiliate link when buying cool stuff in the asset store: https://assetstore.unity.com/?aid=110... [Affilate link]
🎮 Play my latest game on Itch.io 🎮
https://christinacreatesgames.itch.io...
#unitytutorial
Watch video Create a Squash and Stretch effect in Unity with code (2D, 3D, UI) online, duration hours minute second in high quality that is uploaded to the channel Christina Creates Games 17 October 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 6,080 times and liked it 324 visitors.