Player Attribute Script

Hello!

emm, first i don’t know if my Question is right, but just tell me if i’m wrong, i’ll correct it… :smiley:

emm, so basically, i confused how to create Player Attribute Script…

For starting, i have a char selection scene, so i can select to play as a Girl or Boy…

and in every of my scene inside the game, i create 2 prefab which is Girl and Boy, but from the char_selection scene, i flag the selection so in every scene, it will read the selection, and destroy the unselected prefab… and move the selected to place i want…

for example, i choose Girl, then i move to game_Scene, there’s 2 prefab there from the start… but because i choose Girl, i destroy the Boy and move the Girl to the center…
the problem is…

i confused, where to place the player attribute? i mean if i place it on the prefab, will the attribute saved for the next scene (like hp, exp, level)? or it will renew because i load new prefab?

should i place the script in every prefab (i mean on the Boy and Girl)?

Thanks before :slight_smile:

I think you should just store player’s choice in a variable inside a non-destructible object (empty game object will do with DontDestroyOnLoad() ) and the models will be just dummies. Therefore, there will be just one script on one object. When your scene starts, just use something like FindWithTag or Find inside your Player object to reference that stats object and you’re good to go.