I'm still learning and figuring out classes and scope etc.
I have the following:
#init gets called when an object of this class gets created
self.bat = bat
#frame by frame update
#it's good to be able to handle input from within the state
if event.type == InputEvent.KEY:
var mousePosition = get_viewport().get_mouse_pos()
On that last line I'm simply trying to find the mouse position. I get the following error though:
Invalid call. Nonexistent function 'get_viewport' in base 'Reference ()'.
I'm SURE it's to do with scope. How could I get the position from within this function then? I'm really struggling and have spent hours on this. Any help would be greatly appreciated. Brain is shutting down :-)