I currently have a walking throw set up like this, player entity can't grab but as you walk forward and press attack player throws enemy by interrupting attack and switching to throw if enemy is within set distance
but sometimes it doesn't execute the throw and instead micro stutters or not at all unless I interact with entity first
any tips on making a walking throw smoother?
Code:
void walkthrow(int RxMin, int RxMax, int Rz, void Ani)
void self = getlocalvar("self");
void target = findtarget(self); //Get nearest player
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
int dir = getentityproperty(self, "direction");
int iPIndex = getentityproperty(self,"playerindex");
void lef = playerkeys(iPIndex, 0, "moveleft");
void rig = playerkeys(iPIndex, 0, "moveright");
if(target!=NULL()){
float Tx = getentityproperty(target, "x");
float Tz = getentityproperty(target, "z");
float Disx = Tx - x;
float Disz = Tz - z;
if(Disz < 0){
Disz = -Disz;
}
if( Disx >= RxMin && rig && Disx <= RxMax && Disz <= Rz && dir == 1) // Target within range on right facing?
{
performattack(self, openborconstant(Ani)); //Change the animation
} else if( Disx >= -RxMax && lef && Disx <= -RxMin && Disz <= Rz && dir == 0) // Target within range on left facing?
{
performattack(self, openborconstant(Ani)); //Change the animation
}
}
}
but sometimes it doesn't execute the throw and instead micro stutters or not at all unless I interact with entity first
any tips on making a walking throw smoother?