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_gavs2 жыл бұрын
Thanks! I just faced this problem but remebered it from courses and here is your video)
@MetalStormGames2 жыл бұрын
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.
@BirdmaskStudio2 жыл бұрын
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.
@MetalStormGames2 жыл бұрын
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
@CHEEZEyCHEEZE2 жыл бұрын
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.
@MetalStormGames2 жыл бұрын
Glad it helped you out, I want to do a lot more of these Basics type videos coming up as well.
@NOPW_MOD_APK4 ай бұрын
Thanks 😁
@FaKz924 күн бұрын
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?! 🤔
@MetalStormGames3 күн бұрын
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
@svedzmusik2362 жыл бұрын
TY for this video. Ive got a question; is there any way to do this using a prefab
@MetalStormGames2 жыл бұрын
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.
@svedzmusik2362 жыл бұрын
@@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