I'm trying to make a very basic Momento JS class, but when I call the functions within the class I get the error message storeState and applyState are not members of Momento.
Here's the code for my class
class Memento
{
var objectRotation : Quaternion;
var objectPostion : Vector3;
function storeState(player_Object : Transform)
{
objectRotation = player_Object.rotation;
objectPostion = player_Object.position;
}
function applyState(player_Object : Transform)
{
player_Object.rotation = objectRotation;
player_Object.position = objectPostion;
}
}
I then call the functions Momento.storeState(transform object) or Momento.applyState(transform object), but then get the above errors - 'storeState' is not a member of 'Momento' and 'applyState' is not a member of 'Momento'
Any advice is appreciated.