Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

How to pass weapon owner name to projectile?,

$
0
0
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.,

Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>