Allow animating material parameters in specific slot
KaoruBoy
Unity's Material object allows animating properties of all materials on a renderer, there's no built-in way to target only a specific material slot, meaning you have to create a separate mesh if you want to animate the same property on 2 different slots, unnecessarily increasing the performance rank.
This could be implemented by either adding a state behavior which copies a parameter to a mesh's materiał parameter at a given slot or by adding a new component, which contains an array of ints/floats/bools and a reference to the renderer, material slot, and the property path. Unity doesn't allow defining custom properties at runtime, like how Material does with shader parameters and Skinned Mesh does with blend shapes, but accessing array elements by index is possible. When the value at a given index is animated, the component would set the property at a defined material index of provided render
Log In
Muurzik
YES!! Right now I'm not racking my brains over the avatar, but over the world, but still... I wanted to animate the car's materials for vintage, I created a U# script that holds an array of materials and an array of values for them, but when recording the animation, it says in huge letters U# Behaviours CANNOT BE ANIMATED. That is, it is easier to build a heavy scripting system instead of JUST animating for a couple of minutes and forgetting about it.