Unity Basics - How to access other scripts

  Рет қаралды 3,378

MetalStorm Games

MetalStorm Games

Күн бұрын

Пікірлер: 14
@MetalStormGames
@MetalStormGames 2 жыл бұрын
I see this question asked on Discord and Forums a lot from beginners, here are some simple ways to get started accessing other scripts and variables! Thanks for watching.
@aleks_gavs
@aleks_gavs 2 жыл бұрын
Thanks! I just faced this problem but remebered it from courses and here is your video)
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Glad it helped! This is just a few of the many ways you can do it but its a great place to start learning from.
@BirdmaskStudio
@BirdmaskStudio 2 жыл бұрын
Great tutorial on the basics of accessing other scripts! Something else that could be good to break down, going on from this example, would be using 'inheritance' scripts. How they can be use for handling stats like health and possibly even the use of function calls that can check values as you change variables to check for states like death. Quite a bit more complex, but I remember it taking me so long to get that when I was starting out.
@MetalStormGames
@MetalStormGames 2 жыл бұрын
I was thinking that when I made the video having to add the name variable in each script. I am adding Inheritance to a list of basics topics to do in the future. Thanks
@CHEEZEyCHEEZE
@CHEEZEyCHEEZE 2 жыл бұрын
This is awesome. I hate having to drag everything piece by piece. And all of the tutorials show this same process of drag and drop.
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Glad it helped you out, I want to do a lot more of these Basics type videos coming up as well.
@NOPW_MOD_APK
@NOPW_MOD_APK 4 ай бұрын
Thanks 😁
@FaKz92
@FaKz92 4 күн бұрын
Finally got a solution, thanks. The only thing is, I wanted to save the highscore, therefore it was private in the other script, due this I had to set it public. Are there any ways to leave it private and still get access to it?! 🤔
@MetalStormGames
@MetalStormGames 3 күн бұрын
If you search for Properties that should help with that, it will let you control how to access it from other scripts without making it fully public
@svedzmusik236
@svedzmusik236 2 жыл бұрын
TY for this video. Ive got a question; is there any way to do this using a prefab
@MetalStormGames
@MetalStormGames 2 жыл бұрын
You could put any script like this on to a prefab yes but it would depend what you are trying to do and what you are trying to access. If you a specific scenario in mind please post it and I can try to answer a bit better.
@svedzmusik236
@svedzmusik236 2 жыл бұрын
@@MetalStormGames hi ty for getting back so fast. Basically, i want to make it that when my player gets hit by a missile, all the instantiated missiles disappear. This is so that when I click on play again I can't get killed by a non-despawned missile
@troyna77
@troyna77 2 жыл бұрын
ty.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,4 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
How to get a variable from another script in Unity (the right way)
15:44
Game Dev Beginner
Рет қаралды 103 М.
Better Coding in Unity With Just a Few Lines of Code
15:27
Firemind
Рет қаралды 320 М.
Spawning Objects in Unity [Using Instantiate]
10:23
Press Start
Рет қаралды 242 М.
I Made a Zero Player Game
12:30
Sam Hogan
Рет қаралды 10 МЛН
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 557 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 1,5 МЛН
Speed Up Compile Times in Unity with Assembly Definitions
9:54
Game Dev Guide
Рет қаралды 95 М.
I found UNRELEASED Scratch Beta Files!
8:20
ProjectLabs
Рет қаралды 48 М.
Interacting with Objects and Code in Unity3D
30:03
Jason Weimann (GameDev)
Рет қаралды 31 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН