Hey guys!!
Im new to unity3d engine and im working on a FPS project.
I have my gun model i i’ve animated it to “GunFire”, “GunSprint”, “GunAim”… (Some more)
My question is, how to make the gun that shoot, make damage and play my animations?
For example: My gun deal 30 damage, when i hold “LShift” and run around, it play “GunSprint” animation, and when i press and hold my “RMouse”, it play “GunAim” animation?
Please help :<
Thanks u guys so much
(Im using FPS_Controller prefab from the Default Asset as my player)
I’ll try to answer some of it since Im just blankly staring at the screen after just waking up, so add an animation to your prefab as in just add component and type “animation” not animator. Click Animations in the inspector and then see where it says size? Type 1 in the size, then drag your animation into the element 0 AND into the regular animation spot above that, so twice.
Then in code under something like
mouse 0 is left click 1 is right click and 2 is middle mouse button
if (Input.GetMouseButtonDown (1)) {
gameObject.GetComponent<Animation>().Play ("animation exact name");
}