Hello, I need some explanation because of my Script I can’t get it why it’s not working.
I’ve tried to get it on that way like in this tutorial http://unity3d.com/learn/tutorials/modules/beginner/scripting/getcomponent?playlist=17117
First Script:
public class PlayerMover : MonoBehaviour {
public float playerJump =5f;
public float playerMovementSpeed = 7f;
private float playerRotationSpeed = 100f;
private Rigidbody playerRB;
}
Second Script:
public class powerUPsSystem : MonoBehaviour {
public float updatedSpeed = 9f; // I want to replace 7f to 9f;
//PlayerMover Standard = new PlayerMover();
public GameObject otherGameObject;
private PlayerMover plmoverscript;
void Start () {
plmoverscript = otherGameObject.GetComponent<PlayerMover> ();
}
void Update () {
Debug.Log ("speed" + playerMovementSpeed); // variable does not exist ..
}
And so:
Why that variable is not exist even it’s public not private… ?
As you can imaginate Second script is for powerUP so I will try to change standard variable but that is not necessary for this moment. Right now I need knowledge of that first problem.