How to Pass Variables Between Scripts in C#

preview_player
Показать описание

In this video you are going to learn how to pass variables between scripts in C# and Unity.

Рекомендации по теме
Комментарии
Автор

Add the Awake() method seems to be the secret sauce. I've been banging my head for hours trying to figure out how to pass anything between different classes. I'm new to unity but I'd done lots of java, so this was really frustrating. I don't know why that worked or made the difference but I'm glad it did. Thanks!

jimmyjakes
Автор

Bless you. The heavens are shining through the stormy skies, rays of sunshine terraforming the frozen tundra of my soul. This is so incredibly helpful! For 2 days i've been realizing what I needed to understand about passing data between scripts and objects, and your content has created a major breakthrough in my abilities.

Now I can have an object with a fixed hinge attached to my player object, and rotate just the hinged object.

-Com
Автор

Thanks. This was always a question of mine when i first started learning unity. I have watched several videos on this and think this is a good way to comprehend it.

justusiv
Автор

dude, thank you so much for this. in my comments i actuall used words like pitch and catch to help me remember what the functions responsibility was - which is very grounding. WELL EXPLAINED

LiquidWhispr
Автор

Thanks so much! I've been trying to figure this out for days now but eventually, I asked the right question and found this wonderful tutorial!

crosstross
Автор

Huge thanks! I almost gave up on a project cos I couldn't figure it out... turns out it was super simple, and I had done it before without even knowing...

NobSwitch
Автор

dang, saved my desire to do gamedev, cant thank you enough!

not_herobrine
Автор

would defiantly still recommend, wouldnt know how to survive without this

willdyer
Автор

This really helped with a death counter with multiple kill boxes, thank you!

funnymomentsman
Автор

Thanks a lot! Its much easier once you understand it. Also, the rugby-methaphore helped a lot (:

mrfabi
Автор

Pretty cool, well explained and to the point. Thanks

rubendarioramirez
Автор

Really nice bro
But ihave a doubt in unity
Please do any video on vector2
And transform.position
And how &where to use it.
Plzee bro do a video on it

vigneshthedubsmasher
Автор

Thank you, exactly what I was looking for.

iwannabeadoor
Автор

thank you so much for this video it is exactly what i was looking for.

ryanh_dev
Автор

thanks so much! I used this for health on my FPS

beckiverson
Автор

awesome vids
ill have to watch them all

justahuman
Автор

This is amazing, this really helped me out. Thank you so much!

lucasburford
Автор

2:59 i see your paddel is a real karen here

coraku
Автор

Thanks really helpful tutorial! but what is the difference between FindGameObjectWithTag and FindObjectOfType? which one is more e efficient?

azman
Автор

Yep, That's helped me too. thank you very much

skyke