K
K
kitasS2019-03-27 17:14:41
Game development
kitasS, 2019-03-27 17:14:41

How to access a variable from another script in Unity?

5c9b84fe6ee23320186090.jpeg
How to get the value of clickedIs variable in carPhysic. I am new to unity, please help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2019-03-27
@kitasS

Unity has almost nothing to do with it - this is knowledge of c #. You need carPhysic to have a reference to an instance of the ClickScript class from which you want to get values.
How this link will appear there - there are many options - for example SerializeField.
I will not write the code - otherwise you will not learn anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question