hello,
I am doing a pick-up stick game. I got an animated Hands which do all the animation.
In two animations, the hands supposed to grab a stick or two and move them all the animation.
I created a stick and parent it to the hands but when Hands do the animation, the stick doesnt move.
here is the function:
void DoAnimation(){
if(corretlymodeIndex==4){
StickForAnimationPreFab=Instantiate(StickForAnimation,GameObject.Find("StickPlace#2").transform.position,Quaternion.Euler(0,0,90)) as GameObject;
StickForAnimationPreFab.transform.parent=Hands.transform;
StickForAnimationPreFab.parent.animation.CrossFade(animationNames); // i tryed to do this because it wrotten somewhere that it is slove the problem but i have a error:
}
else if(corretlymodeIndex==5){
Hands.animation[animationNames].speed=5;
StickForAnimationPreFab=Instantiate(StickForAnimation,GameObject.Find("StickPlace#2").transform.position,Quaternion.Euler(0,0,90)) as GameObject;
StickForAnimationPreFab.transform.parent=Hands.transform;
StickForAnimationPreFab=Instantiate(StickForAnimation,GameObject.Find("StickPlace#3").transform.position,Quaternion.Euler(0,0,90)) as GameObject;
StickForAnimationPreFab.transform.parent=Hands.transform;
}
Hands.animation.CrossFade(animationNames);
Time.timeScale=0.2f;
}
please help me…