I am working on making a zelda-type game, and i am trying to make a script to make the sword swing. I am using the transform.RotateAround function, and I can’t get it to work. Nothing happens. It deletes the sword clone after 1 second, but nothing happens before that, I don’t even see the object appear in my game window, when it does in the hierarchy.
void Update () {
if(Input.GetKeyDown("x")){
var P = (GameObject)Instantiate(sword,transform.position,Quaternion.identity);
P.transform.parent = transform;
// Spin the object around the world origin at 20 degrees/second.
transform.RotateAround(transform.position, Vector3.up, -180);
// Destroys the swords created after one second
// of creation, in order of creation
GameObject[] killEmAll;
killEmAll = GameObject.FindGameObjectsWithTag("Sword");
for(int i = 0; i < killEmAll.Length; i++){
Destroy(killEmAll*.gameObject, 1);*
-
}*
-
}*
-
}*
}