I honestly have no idea where the problem is. I have a player who is supposed to shoot bullet and he has a empty object as Child, which is supposed to make the bullets spawn there. My prefab is correctly attached to the script, but when I start my game, the prefab/bullets are getting shot miles away from my camera. I have no idea why they are so far away from my player
public GameObject Shot;
public Transform Bulletspawn;
public float fireRate;
public float nextFire;
void Start () {
}
void Update () {
if (Time.time > nextFire)
{
nextFire = Time.time + fireRate;
Instantiate(Shot, Bulletspawn.position, Bulletspawn.rotation);
}
}
I already tried that. I even reset the prefab and all, but for some reason when I drag it into the scene and reset the position to 0,0,0 it’s not at the 0,0,0 coordinates. Every object I have is in the middle of the scene when I put them at 0,0,0. But the prefab bullets float somewhere in the air at these coordinates
The shots spawn at 0,24,-26 which is way out of my camera. The weird part is that there is nothing else. No clue why they spawn at a location like this