hello, i’m back after two years, starting a new game project, last unity version i had used was unity 2016.
now i’m using unity 2019 and i’m learning about the changes made in unity in these two years.
i’m facing an issue, maybe a newbie one, i’m trying to instantiate a bullet at some empty child from my prefab gameobject transform, but when i move my master object and try to instantiate the bullet again it keep instantiate at 0,0,0
these is the code i used to instantiate my bullet
any help will be very useful
thanks in advance for all your help.
if (Time.time > delay)
{
Rigidbody bullet = (Rigidbody)Instantiate(BulletPrefab, WeaponFireLocation.transform.localPosition, Quaternion.identity);
bullet.AddForce(WeaponFireLocation.forward * 1000);
delay = Time.time + attack_rate;
}
p.s.: all variables and object are valid, not empty or null variables are in the code.