Launched character abruptly loses velocity mid air

Hello,
I have been struggling with this issue for a couple of days now. I am using SuggestProjectileCustomArc to compute the launch velocity needed to launch the player from his current location to a preset landing zone.

When the character is launched, the trajectory seems ok, but then the character abruptly loses all velocity and just falls.
I have tried setting the movement mode to flying, but it does not change anything.
Video example

Edit: Cropped code example

I don’t think this code is the issue as the launch seems fine. No idea what it could be though.

1 Like

I had this issue as well. This is the first time seeing someone else with this similar issue. The difference between your logic and mine is I am adding velocity to the existing velocity on tick and I think “Launch Character” is bugged at times.

I cannot find a reliable way to reproduce it in any way shape or form sometimes it works sometimes it doesn’t. I can even print the execution as it fires every frame and the velocity simple dies out, yet it is still called every frame with no external interruptions in any other logic.

I know this absolutely does not help… Hopefully someone else will chime in with this issue as well and maybe a bug report can follow.

1 Like

Change Set Actor Rotation to Set Control Rotation. This is specific to Pawns.

Also you will want to break the rotation and not modify Roll. Just Pitch and Yaw.

1 Like

Thanks for the reply!
I tried the following logic, is it what you were suggesting?

Unfortunately, it does not fix my issue as I still have the same behavior.
I tried setting the rotation before the launch instead of after, but in both cases, the result stays the same.
I also tried disabling controller inputs during the launch, to no avail.

Is there any collision in the way that your character may be colliding with?

So after digging around:
If launch logic is moved on a player input instead of a sphere collider serving as a triggerbox, it works as intended if override xy is set to false.

However, the approach with the trigger box (which is what I want) does not work for some obscure reason (I am using begin overlap and checked it does not get called twice).

I made sure there are no collisions.
However, what I noticed is if the launch is called resulting a begin overlap with a sphere collision, it then has this weird behavior.

If you place a print string here:

image

How many times does it print?


  • what actually triggers it, running into an overlap volume?
  • do you have any events when overlaps end?

You know what, you might be on to something.

If playing in client mode, then client and server are triggering. Client will trigger first do to client-side prediction.

@ArcadeScroller On the triggers event slap a switch has authority OR an is server branch before any other code. Use Authority or True so that the server is the only proxy applying the launch.

Hi, thanks for giving this a look.
I decided to start a third-person project (the one provided by Unreal) and add only the launching logic to it. Everything else is the default settings.
I added the launch logic into a custom event on the player character called launch. I then created a class containing a cube with no collisions and a sphere collision around it.
On begin overlap with the sphere volume I cast the other actor to a player character and call the launch event.
The landing zone is just an empty actor class placed somewhere in the level.
I added a print “launch request” on begin overlap and a print “launching” inside the launch event.
Both only print once.

The same launch event when called on a player input (space bar in my case) performs the launch as intended when done from rest.

I tried both the switch and is server branch, did not work :frowning: .
I tried to run the fresh thirdperson project in standalone, listen server and client, no difference either way.

Don’t use get all actors of class. Have the Overlap box pass it as an Actor reference.
So on the “Launch” event add an Actor Obj Ref input.
When you call the event just pass a Self reference to the Actor pin.

side note, stop using Get Player Controller. Use Get Controller.

Mystery solved!

TLDR in case someone ever has the same issue:

  • You can keep xy override set to true
  • Either put “Braking Deceleration Falling” of the character movement component to 0 until landing or find a way to account for it.
  • Don’t forget to pass the gravity scale of the character to the suggest function.

Long story short, it was the “Braking Deceleration Falling” setting in the character movement component that was killing the lateral velocity.
I tested setting it to 0 in my own project before posting this issue but it didn’t work for some reason.
I tried again in the third-person project I created and it solved the issue. My guess here is the suggest velocity function does not take into account the braking deceleration. This is not an issue on short distances but is one on longer ones.

The reason it kinda worked through the input is I was using the default IA_Jump which had a trigger on both pressed and released.

Thanks to @Rev0verDrive and every one who pitched in!

@Humanasset give the solution a read in case you had the same issue

1 Like