Hi everyone,
I already read many articles about how to pass data between script in Unity, but neither of them work for me. This is how i am trying:
-
I have two objects: a cube (named Cube1) and a sphere (named Sphere).
-
Both have Rigidbody.
-
In Cube1 script I create the script “cubeCollision”. There is a public variable called “contactPointPaddle = 10”.
-
In Sphere script I create the script “BallBehavior”. I am trying to acess the value of “contactPointPaddle = 10” this way:
padContactX = GameObject.Find(“Cube1”).GetComponent().contactPointPaddle;
But nothing happen! Even I set “contactPointPaddle = 10” as static and try to acess by padContactX = cubeCollision.contactPointPaddle nothing happen as well.
What I have missed?
PS: some links I read:
PPS: sorry for my poor english. Still studing…