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
}
}