F4ll_ouT
05-18-2012, 08:17 PM
Hi all,
well my question is pretty simple I hope. I wrote an Iterator and it seem to work.
But I use a third person camera and I'm checking for visible Pawns in range. It looks like my condition was written wrong because I don't want the owner pawn to be recognized but it does.
exec function CheckEnemy()
{
local Pawn checked;
ForEach VisibleActors( class'Pawn', checked, 64,(Pawn != None) ? Pawn.Location : Location )
{
if (checked != none && checked != Owner)
{
`log("Enemy In Range");
}
else if (checked != none && checked == Owner)
{
`log("Something in Range");
}
else
{
`log("Nothin in Range");
}
}
}
When I start the Iterator in game, I just get:
"Enemy in Range" although I can just see myself.
I get
"Enemy in Range"
"Enemy in Range"
when I see myself and the enemy pawn at once. What have I done wrong? Can someone help me with this?
well my question is pretty simple I hope. I wrote an Iterator and it seem to work.
But I use a third person camera and I'm checking for visible Pawns in range. It looks like my condition was written wrong because I don't want the owner pawn to be recognized but it does.
exec function CheckEnemy()
{
local Pawn checked;
ForEach VisibleActors( class'Pawn', checked, 64,(Pawn != None) ? Pawn.Location : Location )
{
if (checked != none && checked != Owner)
{
`log("Enemy In Range");
}
else if (checked != none && checked == Owner)
{
`log("Something in Range");
}
else
{
`log("Nothin in Range");
}
}
}
When I start the Iterator in game, I just get:
"Enemy in Range" although I can just see myself.
I get
"Enemy in Range"
"Enemy in Range"
when I see myself and the enemy pawn at once. What have I done wrong? Can someone help me with this?