How can I use a float Variabel in an other Sript?

Hello,

There are many answers about that, but I do not understand there for my work.

I use the LocationService Script from Unity - Scripting API: LocationService.Start. And it works well. The latitude and longitude I would like to use in a javacript and do some calculation with it. How is the correct Way to put the latitude and longitude to the Calculation-Script?

Thanks for answering!

First of all, the variables you want to refer to have to be marked public in the original script.

Secondly, you have to get the GameObject that the original script is attached to, and you can get the variables this way:

gameObjectScriptIsOn.GetComponent<NameOfOriginalScript>().nameOfVariable

Tasarran

Is it then:
CalculationScript.GetComponent().latitude
?

This is not working. There are some Tokenmistakes.