Hi, anyone have any idea how to excess score variable from different scene as i want to show it on the scoreboard as the game end.
In my case, for the first scene, i have a script named “score” attached on the box collider component named “destroy_area”, the script have a variable named “point” to store all the points collected.
For the second scene, i have a 3D text named scoreNumber to view back the variable “point”(from first scene).
Any possible to make it works?
here is my current code:
(destroy_area script in the first scene)
public var count:int =0;
...
...
count += 100;
GameObject.Find("guiNumber").guiText.text = "" +count;
(second scene)
var other : destroy_area;
latestScore = other.GetComponent.Find("score").point;
GameObject.Find("scoreNumber").guiText.text = "" +latestScore;