Hello Unity3D i have a question about projectiles with animation frames.How can i make it that a projectile that i have created plays at a certain frame of an animation that my character plays?for example my character does a roundhouse kick and the roundhouse animation has 10 frames how can i make it that when the animation hits the 10th frame a fire particle comes out of his leg?or i have another character that has guns and i want to make it that when he shoots (he also has 10 frames) at the last frame the bullet comes out of his gun?
If anyone knows how to fix this problem.Can you please tell me how it can be corrected?
Also this is something i have tried to get the idea of what it needs in order for it to work
var rocket : Rigidbody; //our prefab
var throwPower : float = 10; //power variable determines how fast this object will be "shot out"
function Update () {
if(animation["Shoot_combo_2"].time == 10){
var clone : Rigidbody; //variable within a variable
clone = Instantiate(rocket, transform.position, transform.rotation); //the clone variable holds our instantiate action
clone.velocity = transform.TransformDirection(Vector3.forward * throwPower); //applies force to our prefab using the "forward" position times our throwPower variable
}
}