public void FireBullet(Vector2 direction, float rotationZ) { ArrowScript tmp = Instantiate(arrowPrefab).GetComponent <ArrowScript>(); tmp.Initialize(player.transform); tmp.transform.position = arrowStart.transform.position; tmp.transform.rotation = Quaternion.Euler(0.0f, 0.0f, rotationZ - 45); tmp.GetComponent <Rigidbody2D>().velocity = direction * arrowSpeed; }