pawns spawn with 2 controllers

has anyone noticed that pawns spawned through kismet have 2 controllers unless the controller type in the actorfactory is set to none?

I am trying to trace the cause of a spike in performance at 1 second intervals.

for debugging I had been tracking a certain controller type and I always got the correct number.but when I added a second type of ai and changed the foreach to count all controllers instead of this 1 specific 1, I noticed that the number was doubled and when I kill a zombie,only 1 controller is destroyed.this leaves me with a steady build up of unused controllers hanging around.the more I kill the bigger the spike.

this also happens with a utbot and utpawn combination in kismet so im sure im not the first to suffer from this.

unfortunately,we still cant access the udk forums-where im sure I could find an answer.

I tried this to destroy the controllers I don’t want but I get the comparison will always succeed error.


function destroycontrollers()
{
    local controller atc;
    
       foreach WorldInfo.Allcontrollers(class'controller',atc)
		{						
			if(atc != class'boltonszombie_ai') 
                        {
                           atc.destroy();
                        }
		}

}

wouldn’t know as I don’t spawn pawns via Kismet.

can you check if the Controller has a valid Pawn as the criteria for destroying it?

Can’t say I’ve noticed that, I always specify a controller with the pawn class

,I will try when I get a minute today,good suggestion.

Yummy-Vegetables.so do I,both in script and within kismet.i thought this may be the problem and removed the reference in script,but no change.

I tried spawning through my gameclass instead of kismet but always get “pawn was destroyed because of collision at spawn point” or something similar,no matter where I spawn.

I assume you use the actor factory node not the ex node (not used that) and then select the actor factory AI.

Why not copy a factory node to a default clean map and spawn an AI and see if you get the 1 or 2 controllers. It’ll be easier to debug on a clean map if it fails or go through and disable all factory nodes except 1 in a map that fails and check there. In case there’s a bug in your kismet logic at least you can break it down to a single kismet node.

already done that,as you say its much easier to monitor in a clean map.

it is an actor factory and not an actor factory ex.but I have been using UTactorfactoryai and not actorfactoryai inside the actor factory.i just swapped over and voila!

I now have the correct amount of controllers,but the pawns don’t move till I shoot them,still,one step closer.

thanks.

on your AI’s Possess function make sure you call Pawn.SetMovementPhysics() on them :slight_smile:

strangely,it doesn’t work if I do it in script,but it does if I set pawns physics in kismet.nice 1.

thanks.

edit:works in script in pawn rather than controller.