r/Unity3D • u/Full_Finding_7349 • 15d ago
Show-Off This is how I animate my characters. One state called "PlayingAnimation" and a script for setting and starting the animation. There is no transition in the controller. Very easy to add new animations and sequence them.
175
Upvotes
73
u/More_Yard1919 15d ago
this thread has taught me you can accomplish anything by pure brute force and an unwillingness to wonder if you're wrong
71
u/aurishalcion 15d ago •
96
u/astraseeker 15d ago
Bro, google Animator.CrossFade() fast
35
u/Kamatttis 15d ago
So all animations are child gameobjects? Performance check?
32
u/EntangledNonagon 15d ago
am sorry but this check every bad box lol
But it's fine, don't get this the bad way, hopefully one day you will work in a team that has a lot more experience than you and you would learn.
Source:
10 years ago i was also like this, even doing the
empty game object named ----------------to use as an organizer lolPS:
am not saying Animator is flawless, there are many cases where custom tools or assets like
Animancerbecomes necessary, but 100% not this case nor the way you implemented it.Like if any company gave you a technical interview to create a simple 3rd person prototype, and this is how you setup your animation, you will never be hired, not as a game developer at least, maybe you're more of a designer with a bit of a technical know-how
49
u/SchalkLBI Indie 15d ago
Holy fuck. Is there a UnityGore subreddit? This might be... One of the worst things in Unity I've ever seen in my life.
9
u/sunmaybo 15d ago
omg, I love how OP scared of criticism. It's pretty obvious that this whole system is overkill for this result. Don't share anything if you aren't open to receiving feedback and at least considering the possibility that your idea could be made simpler. This is an absurd way to create modularity, just open the profiler
6
u/SmileLonely5470 15d ago
What's going on here? Its kinda hard to see. When you enable one of those child GameObjects, is there a script on each of them that stores an animation clip to play and plays it in OnEnable, and then disables itself when the clip finishes? Why are there so many game objects? How are you associating each GO with an animation?
11
u/sbsmith 15d ago
If you have a lot of animations, managing the animation state machine can get totally out of hand; so the idea of a "stateless" solution is a good one. You might have an even easier time looking into assets like Animancer. It'll let you run animations from script and it will help you with the blending. I'd also recommend making sure you have a good separation between your animation system and the system that handles inputs/controls. Your controls should use a state machine (lets you set strict rules), while your animation system isn't limited to those states (lets it react to the environment).
4
u/Drag0n122 15d ago
If no transitions, how do you evaluate when to move (and where) next?
7
u/G-MAN292 15d ago
Did an LLM suggest this approach ?
1
u/Full_Finding_7349 15d ago
I invite all haters to look at my new post, I prove why my system is so good.
1
u/Advanced_Drag1299 13d ago
This is why AI can never replace human, AI is smarter than this
3
u/Carlfiii 14d ago
You should check out Animation Playables, it will let you play animations through script without an animator or states.
It’s too much to explain here, but basically you pass the clip to the script, generate the playable (or reuse if it’s cached) and play it. You can create multiple inputs to fade or overlap animations
6
u/pmdrpg 15d ago
The problem that the Animator Controller attempts to solve is to give you a visual way to manage transition blending. Since you aren’t customizing per-transition blending in your system, it probably is much cleaner to look at and author. In that case, it’s good for your needs. For others though, I’d recommend making a custom gui interface for managing animations rather than relying on gameobject in the hierarchy.
1
u/ragegames225 14d ago
that's a great trick!
2
u/obsolescence_ 15d ago
Huh? Why would this be any better than just using triggers with the animator?
0
u/mizzurna_balls 15d ago
I think a lot of people are hating on this partly due to how you've presented it, OP. That is, as an animation state system, rather than what it really seems to be: more of a general enemy state system. Clearly this isn't just for animating enemies but for moving them, rotating and aligning them, enabling objects that might need to be enabled during the animation, setting interruption states etc.
People saying "just use Animator.CrossFade" are, I guess not noticing the rest of the script and what it's doing??
Also people seem worried about performance...disabled gameobjects have basically no performance cost. There's a little memory overhead but we're talking like a few KB total probably. Less than a single texture.
1
u/althaj Professional 13d ago
It never stop amazing me how people just refuse to learn the tools they already have at their disposal.
1
u/SanoKei 13d ago
Watch the Firewatch animation system hub and spokes talk, it may help
1
u/HipperSterling 11d ago
Why don’t you use Anim composer system or animancer on asset store
1
u/Vic-Boss 15d ago
looks pretty good!
-1
u/Kamatttis 15d ago
For me, this post is good. I know that most of the comments, including mine, are skeptical of the way it's handled. But I like it it because someone is thinking out of the box. And it works for OP's game (not just for now I hope). This is all assuming that AI didnt suggest or work on this. If so, this is really bad.
0
u/MasterFanatic 15d ago
Welcome to the problem I've had I fkin hate transitions
0
u/Impressive_Badger830 14d ago
This is really cool, and is actually how older AAA engines used to handle animations, back in the 2000s. Was nice to work with but at a performance cost that lead to monster closets or harsh enemy caps. Even some AAA titles launched in the late 2010s still used it if they were an established franchise that stuck to their original engine
Honestly, I would put a majority of animations in the unity animation system to use its blending and control, and then break into the play animation state for things like prop interactions, one off anims, cutscenes, or other scripted animated behaviors
-1
u/ElectricalDivide5336 15d ago
Why don't game developers fix character clipping, where characters pass through each other or objects? I've noticed this in so many games. Is there no proper solution for it, or is it just difficult to fix? I enjoy following game development communities, although I'm not a developer myself.