I need my character not having the W and S keys this into an animation of rest and presoinar the W and S keys to run the animation is run.
Any suggestions?
Code: Select all
if( IsKeyDown(Key_W))
{
Animate(RUN);
}
Code: Select all
{
// File Script Player
tecla_W [15] // Tecla W.
tecla_S [27] // Tecla S.
tecla_DR [73]
IDLE [Idle]
animIdle [false]
Inicio [()
{
self.yaw_speed =2000; // Velocidad de Giro.
self.ideal_yaw = 180;
Console(true);
BoxWidth(15);
LowLevel("Init");
RestartOrder();
}]
Init[()
{
PositionToPawn("Camara",0,0,0,false,true);
PlayerToPosition(0, 0, 0);
tecla = self.key_pressed;
debug(tecla);
AnimationSpeed(1.5);
AnimateHold(IDLE);
// Teclas movimiento.
if (( tecla = tecla_W))
{
if ( IsKeyDown(tecla_DR)=false)
{
self.ideal_yaw = Camara.current_yaw;
ChangeYaw();
}
}
if ( tecla = tecla_S )
{
if ( IsKeyDown(tecla_DR)=false)
{
self.ideal_yaw = Camara.current_yaw-ConvertDegrees(180);
ChangeYaw();
}
}
return 0;
}]
}