Hello all,
I hope I can get ideas from the community on how to get certain things to work since I’m still new to Unity.
I’m working on a project using the code from the Lerpz tutorial due to time constraints + I’m doing the coding (not an expert programmer) art.
I’ve got everything working as I’d like; but I need to change some scripts because the tutorial involves one scene & I’d like to have mine broken up into multiple scenes.
1st off these are the 3 scripts I’m working on:
- LevelStatus.js attached to the level GameObject.
// LevelStatus: Master level state machine script.
// This is where info like the number of items the player must collect in order to complete the level lives.
I added the following function:
function Update()
{
//stores the number of items to be accessed by the HUD
PlayerPrefs.SetInt(“ITEMS”, itemsNeeded);
}
-
GameHud.js
// GameHUD: Platformer Tutorial Master GUI script.
// This script handles the in-game HUD, showing the lives, number of fuel cells remaining, etc. -
ThirdPersonStatus.js
// ThirdPersonStatus: Handles the player’s state machine.
// Keeps track of inventory, health, lives, etc.
That said- this is what I need to happen.
Pass manipulate itemsNeeded data so that the HUD is updated when a new scene is loaded. I’d like to the same with player health.
I’m having a hard time where I should put the function to do this. I’d like to ask the community for some help on this since I’ve no one to ask regarding code.
(attached a zipped file with scripts for reference)
Thanks in advance,
scr33ner
1081245–40460–$scriptsUsed.zip (5.14 KB)