I have a button when i press it will call the activate function.
The base class is now empty. (Skill) and apparently has nothing to do with it.
I’m just confused why is that “c” value still updates as false value even though i already assign the “c” value to true when i call activate()…
I’ve been scratching my head over for 6 hours and i seriously need help on this.

I’m using tempo skill as a Skill variable and instantiate it during runtime, then i call that activate() via this variable.
Hi. Are you sure activate() is being executed ?
After a quick look… are you sure Input.GetKeyDown(“v”) is ever true and all the if conditions before that are all false? Input.GetKey(KeyCode.V) is more reliable by the way.
Hi. Can you try in your’s skill’s function’s update to add :
Debug.Log(this.name + " c="+c)
to know if it’s still the same skill + remove the “collapse” in the debugging console, to see what’s happening there.
Yes I’m very sure that the input is true and working and activate function is called when i pressed “v”, however I cant Debug this name of the object and it ran into null exception as shown below , i tried to debug in 2 different script.
The first one is before it called the activate function,
the second one is called after the activate function( here, i commented the debug line on the first picture, cuz it ran into error if I don’t comment it which I don’t know why.
Here’s the second scenario after i comment the debug line in the script of previous pic,
I tried to replace the tempo Skill by string name but it seems not working as well. Thanks for the reply, I really appreciate it much.
Ooo okay I’m still quite new to unity . Thanks for the tip.
Yep sorry for that “null”, it should have been :
Debug.Log(this.gameobject.Name)
To display the instance’s name in the debug console. And it can work only if your instance IS a gameobject (which has an inherited “Name” value)
I use that sometimes to know if it’s all my instances or just some, that are having a bug.
So did you find the solution ?
I gave up this method and run with a hardcoding way but hardcoding differnet skill function under my character script. and then calll it in Update() whenever the player pressed any key. Still maybe this proposed method is too advanced for me. haha