I have a prefab octagon with a script attached that rotates it 45 degrees every time it is clicked, and the rotation value (a public float value called currentRot) extends from 0 to 360 (the value jumps right from 360 to 45 after a revolution, this is fine). In another script that instantiates the prefabs, how do I pass the value of currentRot into the second script in order to do comparisons?
1 Answer
1You can find that game object, find it components and dig down to the script, then after you got the reference to the scipt you can access it public values