FloatingPawnMovement - Set Velocity no effect.

Hi, I’m having an issue which I can’t get my head around. The set velocity works when triggered by the Keyboard Event but not when triggered by the OverlapCompEvent.

I’ve debugged and both events work, set velocity is triggered by both and the vector value it’s passed is correct. But for some reason the set velocity seems to be ignored when triggered by the Overlap event, what could be the reason?

I’ve attached some images, one of an isolated test script, my Pawn component setup, and the FloatingPawnMovement component settings.

For context, this is for the player character, and is intended to produce a knockback effect when the character encounters an enemy actor. The overlap event triggers just once.

Also, upon the player character spawning, the overlap event triggers and the set velocity actually takes effect.

Thanks in advance, and if I figure it out I’ll update here.



1 Like

If you keep moving the pawn, its movement component will override velocity in the same frame. Disconnect the overlap for now, keep moving the pawn and hit X. What do you get?


Also, potentially unrelated but the hierarchy may be incorrect:

image

The movement component only respects the root of the actor, and you have no collision there. This may be intended, ofc since you may want to do it manually - judging by the detector components.

3 Likes

Thank you for the quick reply!

I’m away from my desktop now but I can confirm that pressing X while moving my pawn causes it to be knocked as I want. In my full script I also enable and disable the playercontroller to briefly block external velocity modifiers too.

Interesting, so the root comp and the FloatingPawnMovement are linked moreso than the lower hierarchy components? And this could be some sort of ‘tick’ sequence issue? Is it that the Root comp (plus PawnMovement) is ‘ticked’ before the CollisionMesh?

Thanks again :smile:

1 Like

It’s not about more or less or who goes first. There can be only one element the movement comp cares about and it must be at the root of the actor (here, it’s Scene with no collision capacity at all). With no blocking colliders, this pawn will intersect geometry freely.

This may be irrelevant to what you’re making, ofc. However, quality blocking sliding collision is achieved by having a blocking collider as the actor root.


The above does not help your case, though I feel.

this is for the player character, and is intended to produce a knockback effect when the character encounters an enemy actor

It’s a bit curious that X delivers yet overlap does not. I’ll try to replicate it.

  • how do you move the the pawn? Add Input Vector?
  • however unlikely, is physics simulation involved in any of this?
1 Like

I believe this has a lot to do with frame timing:

  • when during the frame does the overlap occur
  • when does the floating pawn movement component update occur

UE obfuscates it and the BPs do not make it any easier.

The overlap triggers before the movement update is processed, the update then overrides the velocity change request; whereas (X) input processing is added after the movement comp has done its job giving it no chance to mess things up. (and Tick Groups seem to play no role here). Someone corrects me if I’m wrong!


One way to easily solve this:

1 Like

Fantastic, I’ll implement this once I’m back at my desktop! Can you recommend any resources so I can learn more about the background processes happening per frame?