Unable to find object - can't find editor-placed static
by Mr Zurkon · in iTorque 2D · 06/09/2011 (1:36 pm) · 1 replies
I've placed a static in TGB that I've labeled with the class CharacterClass (under scripting - class). Here's my function:
I'm trying to call it by writing:
%CharacterClass.moveHorizontally(10);
Error: game/scripts/game.cs (93): Unable to find object: '' attempting to call function 'moveHorizontally'
Did I miss something here?
function CharacterClass::moveHorizontally(%this, %value)
{
%this.setLinearVelocityX(%value);
}I'm trying to call it by writing:
%CharacterClass.moveHorizontally(10);
Error: game/scripts/game.cs (93): Unable to find object: '' attempting to call function 'moveHorizontally'
Did I miss something here?
Employee Michael Perry
ZombieShortbus
If you want to keep it as a class, since other objects might use it, you still need to give it a Name (like Bob):