Quantcast
Channel: Latest Questions by t9s1n2
Viewing all articles
Browse latest Browse all 40

Trying To Do A Sword Attack Animation Using Parents, Local Position And Local Rotation.

$
0
0
First i declare the sword object and the arm object that holds the sword in the editor. public Transform sword; public Transform swordarm; If the player is not attacking then the sword is in the sheath. if (attacking == 0) { sword.parent = transform; sword.transform.localPosition = new Vector3(-6,-2,2); sword.transform.localRotation = Quaternion.Euler(0,90,0); } After a certain amount of time the sword is in the player's hand. The animations are done in blender. I just want to attach the sword to the player's arm after the animation has reached a certain point. if(animation[attack.name].time>0.4*animation[attack.name].length && attacking == 1) { sword.parent = swordarm; sword.transform.localPosition = new Vector3(-3.5f,0.8f,-1); sword.transform.localRotation = Quaternion.Euler(80,45,225); } The problem is that the localRotation and localPosition are not changing.

Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>