- Home /
using unity animation, Is there a way to offset UV of only one material?
Hi !
I have a 2d character, I use a material for the head and other materials for the body. The material for the head has one texture. The texture is an atlas of different faces. I want to swap the face during an animation, that's means offsetting the uv of the material.
I found two differents approach for this problem and none is satisfactory for now
1) I can create a event during the animation, a trigger for a script that call something like
GetComponent<SkinnedMeshRenderer> ().materials [0].mainTextureOffset = new Vector2 (0.5f, -0.5f);
That's is working. The problem for me is that:
is asking for a script and I would like to said in the animation, so that my artist don t bother a coder every time they need something.
it is a problem when blending animation, since the trigger can be missed completely if I don t start the animation at the beginning
So I tried using the animation system a bit more.
2) I have added a Property for Skinned Mesh Renderer.Material._Main Tex_ST
( using the add property button) then I've changed the value z and w for this properties.
This works except it change the offset for all the material on my object, so its messed with the other part of the body.
Question: Is there a way to offset a texture for only one material using the animation view ?
I'm having the same problem as well. Is there anyone who could fix this and share the solution with us?
Your answer
Follow this Question
Related Questions
UV Animation export from Maya? 1 Answer
Unity2D: Animation Event Not Firiring 0 Answers
is it possible to save over animation clips and keep events? 1 Answer
Does UV Animation export from Max? 1 Answer
Multiple animation event on one frame 2 Answers