I have an empty game object for a spawn point. I’m trying to get a sphere to spawn where it is but it spawns in a completely different spot.
I tried using transform.InverseDirection and transform.Direction and neither of them worked. I even tried doing this but it still spawned in a completely separate location.
public IEnumerator EnergyBallAttack()
{
Vector3 spawnPos = handShootPoint.transform.position;
Rigidbody rb = Instantiate(energyBall, spawnPos, handShootPoint.transform.rotation).GetComponent<Rigidbody>();
rb.isKinematic = true;
rb.transform.parent = handShootPoint.transform.parent;
rb.transform.localPosition = handShootPoint.transform.localPosition;
Vector3 savePos = rb.transform.position;
rb.transform.parent = null;
rb.transform.position = savePos;
rb.transform.localScale = Vector3.zero;
rb.transform.DOScale(5f, 0.7f);
yield return new WaitForSeconds(0.75f);
rb.isKinematic = false;
rb.AddForce(handShootPoint.transform.forward * cannonForce * 6, ForceMode.Impulse);
}