Hello, I’m getting an error while trying to access the scriptObject from a ScriptInstance component:
ScriptInstance@ scriptInstanceCmp = result.node.GetComponent(“ScriptInstance”);
Print(scriptInstanceCmp.className);
currentSelectedCharacter = cast<BaseCharacter>(scriptInstanceCmp.scriptObject);
The 2nd line prints out fine while the 3rd line gives a null reference error from angelscript.
This is my global “gamemode” script where I include different .as files for the BaseCharacter. I already marked all my classes as shared so they should be seen across modules as I understand.
Any ideas on what I could be missing - Thanks in advance!
Trevor