1) How do I enable my player pawn to fire projectiles in the direction of the mouse crosshair? I've tried the LowLevel, "MouseControlledPlayer(true);", command in my pawn's setup, but it does nothing (I assume this command refers to the built in player).
2) How do I get my player pawn to auto target the nearest enemy pawn? I would like to add this my attack commands, namely:
Code: Select all
Punch[()
{
if(ATTACKDELAY < self.time) // see if enough time has passed since the animation started
{
FireProjectileBlind(FIREAMMO1,WEAPONHAND2,0,0,0,DAMAGEATTRIB); // shoot the projectile (= do the damage)
attackdelay = self.time + 10000; // make sure the damage is done only once
}
if(self.animate_at_end) // check if the animation has finished
{
self.think="Test"; // go back to the basic routines
return 0;
}
}]
AND
{
if(self.animate_at_end)
{
FireProjectileBlind(FIREAMMO4,WEAPONHAND,0,-8,10,DAMAGEATTRIB); // shoot the projectile (= do the damage)
FireProjectileBlind(FIREAMMO4,WEAPONHAND,0,-8,10,DAMAGEATTRIB);
if(self.animate_at_end)
{
self.think="GalickGunFire2"; // go back to the basic routines
return 0;
}
}]
Much appreciated