Game Development Community

setFrame issue

by Georgina Benedetti · in Torque X 2D · 11/22/2010 (7:50 am) · 1 replies

Hi,

I'm having trouble with the setFrame command. I have an animation that I want to pick a random frame and play just that chosen frame. However I am coming up with an error: Unknown command setFrame. My code is just;

function pressieClass::spawn(%this)
{
%this.setPositionY(%this.startY);
%this.setPositionX(getRandom(-30, 25));
%this.setLinearVelocityY(50);

%this.setFrame(0);
}

can anyone tell me what is going on or how i can fix this bug?

Georgina

#1
11/25/2010 (4:15 am)
It's all good. I didn't have a static sprite sheet selected was the problem. Instead I had an animation.