I’ve made the same mistake today that I’ve made a bunch of times before. Most of the time I remember it, but sometimes I forget. I can’t help it. But today I thought that I’ll write about it.
Animator blocking script from functioning:
When you have a script that modifies for example the transform of an object and at the same time you have an animation that tries to modify the same transform. The Animator takes priority and the script is blocked. Now this would be all fine, but you can have like a hundred animation clips attached to the animator without even touching the transform with 1 animation that does modify the transform and the script is still blocked on all of them. Why block it on all of them? Why not just block it on the ones they actually interfere with?
I usually fix this issue by making a child game object where I put the graphics and have the scripts on the parent. In this case I can use the animator on the child and have the script on the parent. But this seems to me more like a workaround and not a solution.
Here are some other little things that I’ve noticed before and just remembered:
In Particle System when you go to stop action in the inspector and choose callback. You have to make a script with a specific function name that I have to google each time I use it. Why not just make a field where people can pick out a method from that script? Or make it an event and let us subscribe to it.
There is a same thing with UI sliders. It was something like OnSliderChange() would be nice to just have it as an event picker on the slider inspector.
I would really love to have global 2D lights that casts shadows. other 2D lights can cast shadows so why not this one?
I make a basic shader graph that only changes the color intensity. If I put it on a sprite renderer it works nicely, but when I use it on a UI image it gives off a dark background. Where it should stay transparent. Why have separate results? I know the calculation in the back ground is different or so I’ve read. But still.
You’d have to specify the world position of the global light. However, 2D shadows have infinite length. So having the 2D global light cast shadows would create massive shadows across everything. Not only would it look bad, it would also harm the performance greatly.
If you want 2D shadows, you can use the negative lighting technique from happy harvest. It is even better than 2D global light casting shadows because you can animate a day/night cycle with that technique. The only “downside” is it wont use normal maps
Thanks for helping. Each shadow it’s good for different use cases, the negative lighting technique can use normal maps if the light source it’s a spot light or else other than the global light, in the image top, without normal, under with normals
A better fix/workaround is usually to do things that needs to modify objects that are animationed in LateUpdate, as that runs after Update. Nothing is being blocked, it’s just being modified and then modified to a different value. always been a lot worse at drawing Sprites than spriterenderers.
afaik there’s no getting around having to check that checkbox on every. single. state. Which you will forget, and it’ll break your stuff in interesting ways. It’s also not possible to do in Playables or in the Animation component. Maybe when they ship the new animation system that's just around the corner pinky promise in like 2030 there will be an option to have it not be default?