How to prevent deleting values on scene load (C#)

ive been messing around with playerprefs but that doesnt seem the way to go about this
i cant use dontdestroy because that applies to the entire objcet and not the values

i got 2 scenes
lets say on 1 scene you click a circle and get 1 point and the next scene is to spend that point but its reset back to 0, i used to have just 1 scene and 2 cameras but problems occurred when the UI on camera2 was clickable from camera 1 :confused:
they both use a float that holds the score but its reset, as of now i have it so if you press the left arrow it loads the main scene and right loads the shop, i will of coarse change to some buttons on the screen but for now this will do.

You should make those variables static then. Static variables keep their values while the program is active.
Example: public static float score = 0;