How to pass weapon owner name to projectile?,
Evening or Morning. I am trying to pass the weapon owners name to a projectile?
I am able to get the weapon owners name but when i try to pass it to the projectile, the projectile owners name is the name passed...
to get weapon owners name: owner = gameObject.transform.root.name;
Trying to pass it to projectile with: if (projectile != null) { Projectile newProjectile = Instantiate(projectile, muzzle[i].position, muzzle[i].rotation) as Projectile; newProjectile.SetSpeed(muzzleVelocity); newProjectile.SetDamage(damage); newProjectile.SetOwner(owner); // this line here to pass }
projectile script: public void SetOwner(string ownerName) { ownersName = ownerName; }
ownersName always comes back as weapon name in projectile script.,
Your answer
Follow this Question
Related Questions
How do you make bullet Spread? 0 Answers
Unet isLocalplayer issues with child objects of player 0 Answers
How can you do borderlands style random weapons and stat generation? 2 Answers
2D Bullet Not Working 1 Answer
Y Axis rotation is increasing too fast 0 Answers