S
S
Sasha Negruta2018-03-21 19:38:02
JavaScript
Sasha Negruta, 2018-03-21 19:38:02

How to pass a variable to another function?

How to pass the value of a variable from one function to another function?

var score: int;
function get() {
text = "100";
 score = parseInt(text); 
   } 
function Awake()
{
get();
 Debug.Log(score);
}

how to make it display value from get functions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VoidVolker, 2018-03-21
@merrfin

function get(text) {
    return parseInt(text); 
} 

function Awake() {  
    console.log(get("100"));
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question