just need some clearing up

ok so i have played with unity and i understand how it works and all that other good stuff. However what i cant grasp right now is that im starting to make animations and i would like to know,(say im making a shooter) do you animate the character while holding the gun or animate him without the gun and put it in later? I just dont really understand how it works right now so if anyone can give me just a little clearing up on it that would be helpful:smile:

-thanks

Animation is typically done in your modeling application.

no, what im talking about is when you import your character into unity (for a shooter) does the character have to be animated with or without holding the weapon

Animate without the gun, then attach the gun later. But I am sure there are people who have more FPS experience than me.

actually im talking about 3rd person, i just dont really understand how it works

You attach the gun later. What most people do is have a “Weapon_Bone” attached to the hand of the character.

Animate him in your modeling app with the weapon as a child of the “Weapon_Bone” and then when you are ready to import into unity, take the gun out of the character model. Then import the gun model in a second file and attach it to “Weapon_Bone” via scripting.

thank you spiral

Why would it matter if it is TPS or FPS or even RTS. The principles are the same.

my code doesnt seem to be working…

GameObject.transform = myBone.transform;

Of course It wont work,
1- you cannot affect that object’s transform directly,
2 - GameObject is a class, you need an instance of that class like so:
gameObjectIf your class inherits from Monobehaviour, by default you have access to its own Transform instance:
transform.
3 - Here is what you need to do in order to make your weapon child of your hand bone (to follow the hand bone):

//No need to run this each frame, only once
void Start(){[INDENT] weaponTransform.parent = handTransform.transform;
[/INDENT]}

For more info about Monobehaviour class:
http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.html