Unity 2D Platformer Tutorial #12 | Accessing Variables In Other Scripts

Publié le: 17 juillet 2023
sur la chaîne: Robert James
96
1

In this Unity 2D Platformer tutorial, we learn how to access variables from other scripts.

As our project grows, we now have multiple ways to gain points and lose lives. Instead of creating separate score and life systems for every object, we'll learn how to reference existing scripts and update values from anywhere in our game.

You'll learn how to:

• Access variables from another script
• Understand public vs private variables
• Create script references
• Update score from multiple objects
• Update lives from multiple objects
• Connect enemy and player systems
• Use object references in Unity
• Share data between scripts
• Improve your existing score system
• Prepare for enemy movement systems

By the end of this lesson, your enemies, collectibles and hazards will all be able to update the same score and lives systems correctly.

#unity #unity2d #gamedevelopment #platformer #unitytutorial #learnunity #csharp #gamedev #indiedev #UnityScripts #programming #UnityCoding #ScriptCommunication #gameprogramming #unitybeginner


Sur cette page du site, vous pouvez voir la vidéo en ligne Unity 2D Platformer Tutorial #12 | Accessing Variables In Other Scripts durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Robert James 17 juillet 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 96 fois et il a aimé 1 téléspectateurs. Bon visionnage!