- Home /
[Solved!] CANT HOLD FLASHLIGHT UP?
I'm currently using the third person character controller (Ethan) and am trying to edit the animations so that he will always leave his right arm up, and will be able to control it with the right stick controller so he is always holding a flashlight up at the target, anyway of doing this simply, or will I have to edit the individual animations? I tried using this code under the update function but to no avail. Any suggestions are appreciated thanks!
//(CODE SIMPLIFIED)
public GameObject Arm;
void update(){
arm.transform.Rotate(-57.77f, -20.29f, -15.49f);
}
EDIT: It seems that when the game is about to be ended with the play button it goes up to the position I want it at, but not while playing.
Answer by Liaram · Jul 23, 2018 at 05:24 PM
The character animation system (Mecanim) allows the use of animation layers. You could make an Avatar Mask to exclude the arm. That would stop Mecanim from animating it and then you can control the arm through code. But you'd have to do some digging to figure out how exactly to do that. Sadly it's too complicated to explain in a short post.
You're a life saver man, ended up finding this video on youtube that helped a lot. Went into the character animations tab, and created a mask on his right arm so that the animation wouldnt affect the flashlight being held up, simple and useful.
Link: https://www.youtube.com/watch?v=1d$$anonymous$$oRECcstQ