Error

I am trying to instantiate a gameObject at the Player’s position but it is instantiated at some other place which is far from the player’s position.ELse part is working fine but the if part doesn’t work as expected.Can anyone suggests on this
void fireBullet(){

_canFire = Time.time + _fireRate; // restrict the fire rate so that not many bullet objects are created

if(_isTripleShotEnabled == true)
{
Debug.Log(“Trigger Shot enabled”);//+ new Vector3(-15.38f,0.8f,0)
Instantiate(tripleShotPrefab,transform.position,Quaternion.identity ); //Quaternion.identity means default rotation and new vector3 is added for offset

}
else {
// Debug.Log(“Space Key pressed”);
Instantiate(bulletPrefab,transform.position + new Vector3(0,0.8f,0) ,Quaternion.identity); //Quaternion.identity means default rotation and new vector3 is added for offset

}

}

Perhaps the prefab is offset? Check the tripleShotPrefab and its transform (and children, if any).

I have made the Player and Parent of the Bullets vector3 position to (0,0,0) and it worked.This a glitch i think because when we are Instantiating the prefab at the player’s transform position then it should picked at runtime .Thanks for ur response