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
Auf dieser Seite können Sie das Online-Video Unity 2D Platformer Tutorial #12 | Accessing Variables In Other Scripts mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Robert James 17 Juli 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 96 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!