x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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, the movement component does not work. The actor floats wherever I place it, it does not fall or respond to any BP events which affect the 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 the appropriate animations. It just seems as though spawning an AI actor via the BP node forces the 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 the movement component to see if that would fix it; it doesn't.

Product Version: Not Selected
Tags:
more ▼

asked Sep 16 '14 at 09:45 PM in Bug Reports

avatar image

RhythmScript
243 20 24 36

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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

more ▼

answered Sep 16 '14 at 09:53 PM

avatar image

RhythmScript
243 20 24 36

avatar image SkeetonYu Nov 11 '14 at 06:14 PM

What's the node called to give controller?

avatar image Ben Halliday STAFF Nov 11 '14 at 09:26 PM

Hi SkeetonYu and RhythmScript,

In the Defaults for the 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 the way a Character normally does, including falling when spawned above the 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 the Return Value to Possess the new Character.

Hope that helps!

avatar image keyle Aug 19 '15 at 11:42 PM

Thanks Ben!

avatar image NoisE89 Jan 11 '17 at 07:10 PM

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

avatar image KillerPenguin Dec 01 '14 at 08:57 AM

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

avatar image Ben Halliday STAFF Dec 02 '14 at 09:28 PM

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

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

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question