When spawning AI Character actor, why does MovementComponent not activate?

If I drag my enemy Character BP into my level and begin play, it behaves as normal. It is affected by gravity and collision, it executes it’s AI behavior tree, etc.

But if I use another blueprint to Spawn Actor From Class it into existence, movement component does not work. actor floats wherever I place it, it does not fall or respond to any BP events which affect character movement component (such as Launch commands). However, it DOES respond to some commands; it still detects collision with my player’s weapons and plays appropriate animations. It just seems as though spawning an AI actor via BP node forces character movement component to do nothing.

Of note: YES, I checked, character movement component is set to auto-activate
YES, just to be sure, I tried firing an “activate” command on Event Begin Play for movement component to see if that would fix it; it doesn’t.

Never mind, evidently this is intended behavior; spawned actors do not spawn with their default controller. Found node that does this. Strange that movement component would do nothing without a controller attached… but at least this is resolved.

What’s node called to give controller?

Hi SkeetonYu and RhythmScript,

In Defaults for CharacterMovement component there is an option for Run Phyics with No Controller, which is set to false by default. If you enable this, an uncontrolled Character will react to physics way a Character normally does, including falling when spawned above ground.

If you would prefer to assign a controller to a spawned Character, you can spawn a Controller using Spawn Actor from Class, and then use Return Value to Possess new Character.

Hope that helps!

bRunPhysicsWithNoController = true doesn’t work for us… can anyone use this variable at all?

I apologize, I left out a step: you also need to SetMovementMode for CharacterMovement component to Falling or Walking on Begin Play. reason for this is controller is what sets Movement Mode which dictates how CharacterMovement component handles physics. developers are considering initiating SetMovementMode by default when bRunPhysicsWithNoController is enabled (UE-6143).

In meantime, either that method or one mentioned by RhythmScript should get you what you need. Let me know if you have further questions!

Thanks !

Hey man. node is called “Spawn AI From Class”. When using this one actor is spawned with all of it’s controllers and stuff and is working out of box. Spawn Actor From Class is good for things like misiles and things like that.