Answer the question
In order to leave comments, you need to log in
How to take a variable from another script in Unity?
Hello. In short, I have a scene in Unity, there are several objects on which there are scripts. I also have a main script on the cameras, which should use data from scripts on other objects. Help decide.
Answer the question
In order to leave comments, you need to log in
In the camera script, throw a prefab on other objects and use GetComponent to take variables from them.
The path to the image can be obtained by calling the intent of the gallery, in which the image will still be selected and then returned in one of the intent parameters. That is, speaking in Russian, open a program in which the user selects a picture and get from it the path to this very picture. Or use directory listing via Directory.GetFiles, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question