Download

Cannot add movement input to AI pawn not possessed by player?

I’ve tried adding movement input to a pawn that has an AI controller and behavior tree via the pawn, AI controller, and behavior tree, but it doesn’t seem to work anywhere. It will work when the player possesses it, but I don’t want the player to possess it, this is for an AI enemy. Is there no method or setting that will allow it to accept an input vector without being possessed?

I want to be able to have the max speed/acceleration/deceleration advantages of the movement component (that I added via ‘add floating pawn movement’ and do have access to-it’s not a matter of it not getting the component correctly). The ‘move to’ actions for AI will not accomplish what I need, and I don’t want to have to manually set its location or use force/velocity to control its movement. It’s incredibly frustrating for this action to seemingly be locked by the engine for no beneficial reason behind the requirement of being possessed by a player.

If you know of any way I can get the movement input necessary for my AI to be registered correctly I would be incredibly grateful as it’s an integral part of my AI movement design.

I agree it’s sad that the movement component isn’t loved enough to be set free. Sorry I haven’t tested this but can you override the movement component? There’s always the possibility of moving your ai with root motion, if that’s an option.

Yeah it is, especially when it feels like it has been a frequent request for so long.
There is no way to force the movement component to co-operate without possessing it even by ticking ‘force’ in the input vector node to have it ignore the pawns acceptance of input values (which isn’t disabled in the first place anyway), but of course possessing the AI doesn’t work when you want to possess the player and you want to have multiple enemies.

I’m not sure what you mean by not possessing it, isn’t it possessed by an AI Controller? I’ve gotten around having to deal with the movement component directly by setting a value on the AI to control a blendspace animation that contains a root motion override(A constant x/y translation for positive, negative and neutral values can be applied here to override movement) that is only active on the root joint.

d9007beb7e1d6123ce14433e0a7ef46e9d212999.png

I know this isn’t ideal in anyway, but it saved me from having to deal with probably the same thing you’re going through. With this type of solution you would just set a public variable of X,Y,Z on the animation blueprint of the AI to control the blendspace.

That’s an incredibly creative solution and I greatly appreciate the time you took to share it, but sadly that falls victim to the issue I face with anything other than the movement component. You have no control over acceleration/deceleration.
I can get the movement component to ‘function’ by setting its velocity manually, but that just sets the speed, it doesn’t set the desired speed with any acceleration applied.
I could use vinterpto to smooth it out but that’s horrible when wanting a precise end-point and its finicky in how it reaches the end-point/how long it takes to get there, doesn’t work like acceleration.
I could also use timelines to control it but they don’t take into account the current speed well if the enemy starts/stops its movement midway because it changes direction/desired speed or sees the player, and if the behavior tree changes branches midway it’d cut off the timeline too unless you had the timeline running on the pawn or something but that still doesn’t account for changes of movement speed in the middle of an active timeline.
The Movement component is the only real clean solution but for some reason it seems they have decided to lock it behind the requirement of being possessed, which to clarify specifically needs to be possessed by yourself (a player), just possessing it with an active AI doesn’t get it to work as it should.

Then request it as a feature suggestion to Epic, and see if your request sounds reasonable enough to be added into the engine.

It has been requested consistently for as long as I can remember, I’ve heard them mention how frequently it has been asked for in multiple livestreams (many months back), however they continue to keep it locked up like it is, and not being a programmer I have no means of even trying to unlock it myself (I use blueprints to develop my projects).

Ah okay then. Since I am new here, I wasn’t aware of it.