Hi
I’m trying to instantiate a bullet whose position is set to be at tip of the player’s weapon, but for some reason it isn’t spawning at the correct position. See the picture below.
I’m using the following code to spawn the bullet.
public class Weapon : MonoBehaviour
{
public Transform WeaponBarrelEnd;
public Projectile Bullet;
public float BulletVelocity = 35f;
public void Shoot()
{
Projectile newProjectile = Instantiate(Bullet, WeaponBarrelEnd.position, WeaponBarrelEnd.rotation) as Projetile;
newProjectile.SetSpeed(BulletVelocity);
}
}