Here you go:
https://www.dropbox.com/s/u2sdd98j0jf22il/Playmaker.rar?dl=0Bear in mind some things are reduntant for the sake of explaining multiple ways to do the same thing. Here's how things work:
You have an object named
Debug in the scene, it holds TextMeshPro for displaying variable data in string form as well as two FSM's,
DebugButton and
ScoreDisplay. We have an Int Score Global variable and Int ScoreLocal variable as well as string ScoreString variable for display purposes.
DebugButton controls the displaying of Score by using D key. You can toggle it on and off. There is a slight wait between toggle so the states don't enter the loop since i'm using get key and bool, though you can use get key down without the wait for such simple things. When its on, it enables ScoreDisplay FSM, when it's off, it disables it and sets TextMeshPro text to blank.
ScoreDisplay FSM converts Int Score Global variable to ScoreString so we can feed the TextMeshPro with string for display purposes. I used Format string to add "Score" in front of the ScoreString variable so you know what data you're looking at.
Last action, Set Int Value is redundant, but server for demonstration purposes. Bear in mind that Convert Int To String gets GLOBAL int variable, you can use Set Int Value to "copy" global to local variable every frame and use it instead, but more importantly, you can expose local variable in the inspector of the ScoreDisplay FSM, you can't do that with global.
So basically, you can copy the values of all the global variables you're using to local in one FSM and check the Inspector button in the variables menu of the FSM to show them in the inspectorm or make a display of them on the screen with TextMeshPro.
one of the oddest things is that I make this local variables for specific instances, but then there doesn't seem to be a way to find those local variables to delete them (which i would should be in the local FSM variables tab) but that's probably another thread to get into.. heh
No way that's happening, if you made a local variable, it's available for editing in the prefab/instance. I made similar mistakes when i was starting, you're probably using a global variable and think that it's local. Go to globals and see where they're used.