optimized projectile initialization in Root.cs

This commit is contained in:
Adam Salah 2025-07-29 17:34:44 -04:00
parent 7f4f5ac7a8
commit d58496a08b

View File

@ -35,10 +35,10 @@ public class Root : MonoBehaviour
Vector3 spawnPos = (_projectileSpawn == null) ? _rigidbodyAlly.position : _projectileSpawn.position;
GameObject _newArrow = Instantiate(_projectile, spawnPos, Quaternion.identity);
//Warning : the Speed of the arrow is equal to the speed of this unit, if this unit need to move, use an other variable !
_newArrow.GetComponent<Projectile>().Damage = _entity.AttackDamage;
_newArrow.GetComponent<Projectile>().Origin = _entity;
var projectile = _newArrow.GetComponent<Projectile>();
projectile.Damage = _entity.AttackDamage;
projectile.Origin = _entity;
}
public void PlaySound(string soundName)