Using cSharp, I am currently assigning the public float value shootForce as such :
public class Bullet {
public struct bulletData
{
private float _shootForce;
public float shootForce // The force at which missiles travel
{
get
{
_shootForce = 2f;
return _shootForce;
}
set{_shootForce = value; }
}
}
I’m accessing the value from other classes / scripts such as moveMissiles.cs in this way :
Bullet B = new Bullet();
void FixedUpdate ()
{
rigidbody.velocity = transform.up * B.playerBullet.shootForce;
}
How do I assign the value of shootForce to a value contained within an array defined outside the shootForce property.