Hi
I’am making a simple animation , main character is tuning off the switch. What is the better way?
- Make an animation of main character in 3D Software ( turning off the switch) , add one bone to the switch and animate all in 3dSoftware,
2.Make an animation of main character in 3D Software ( turning off the switch) and animation of the switch make in unity, then try to sync all this via scripts.
How you guys do this in your games ?
Hi AngryOrange,
Take a look at my almost done unity animations pack + game source:
http://forum.unity3d.com/threads/150616-Third-Person-Shooter-Game-Special-Agent
http://www.motiontracks.org/index.php?route=information/information&information_id=7
I’ve done the animations in 3ds max, then i’ve sync it to the game. For more realistic effect i would suggest to create the animation with the switch at your 3d software, animate the character and the switch, then export it to unity.
I’ve done it by two ways, the way that i like most to do is animate in 3d software, than do some small adjustments at unity.
The other way i’ve tested is to animate in 3d software but controll the animation with lateupdate in unity to adjust position and rotation. Some times it’s good to do it, some times is not. You could use this second example like i did in my demo, to stepup obstacle you animate it, (the character stepping up) but it doesn’t rotate or move, (just animate in place), then at unity you controll it’s position and rotation frame-by-frame.
Well i hope it help you…
Best of luck
Hi fano_linux thanks for replay. Yours animations are really cool and pro.
I was thinking to make all animations in 3dSoftware but Switch is simple mesh rotation. Should I add bone for this ?
The second thing that is really hard for my is sync all this in unity .
In switch example should I make for example a collider near the switch , when character enter the trigger play animation “turn of a switch” on character and then play animation “lever move” on a switch.? This is the correct approach to do this ?
I am asking because I’am making my first game in unity and I’am trying to learn best ways to make different things. 
Thanks for your kind comments man…
First question: The bone it’s not necessary, it’s just if you need to mark switch position…better use bones when the objects are attached to the character (jus my opinio maybe somebody think it diferent).
Second one: You are right, i would do like this. Create a collider big enough to collide with the character, then on triggerStay(Collider obj) if the collider object is the player (you can add a tag at your main character) and if the player press some button, the animation start. “If you use C# just create a singleton from the script that will run the animation so it can be accessed from the trigger script”. Another tip is to rotate/posiion the main character towards the switch, so it will never fail to play the animation at wrong rotation or position.
example: (player).transform.rotation = (sitchObj).transform.rotation;// of course just an example you can work it better.
In fact there’s alot of ways you can go, i’m presenting you some simple solutions, so you can go foward to this…
Best regards
fano_linux thank you very much for your help. It was really helpful for me.
you are welcome, if you need more help don’t hesitate to call me… best of luck