Help with mid-air projectile arc trajectory

I was wondering if anyone could help me out with a problem I’m having with the mid-air arc trajectory of thrown projectiles.

So to summarize, I have this setup for the sidescrolling platformer game I’ve been working on for a while where the player character is able to throw bombs in an arcing motion.

This setup works for my purposes but only when the player character is on the ground.

If the character attempts to throw a bomb in mid-air then the bomb ends up being thrown in a downward trajectory that hurts the bomb’s overall effectiveness as a weapon / gameplay tool.

Ideally the bomb should always have the same thrown trajectory regardless of whether its thrown from the ground or the air.

Thank you in advance!

1 Like

The change of direction can only come from those 2:

  • does it behave incorrectly when you multi Velocity by 0, too? If the incorrect behaviour does stem from velocity, ignore its Z component
  • get actor forward - does the character rotate when we jump? As that would affect its forward vector. If that’s the case, use world axis instead, just check which way the character is facing.
1 Like
  • I’m not sure what you mean by incorrect behavior being caused by multiplying Velocity by 0. I tried increasing the value by which the Velocity is multiplied by 100 which resulted in the bomb disappearing every time the character tried to throw it in mid-air. I also don’t know what you mean by ignoring the Z component, how do I do that?
  • By the character rotating when they jump if you mean that the character is able to turn around in mid-air while jumping then yes. However, if you mean that the character rotates around normally while doing a normal jump without changing direction i.e. the character does a mid-air somersault while jumping, then no. I also don’t know what you mean by world axis. I know what the term itself generally means but I can’t find any node with ‘world axis’ in the name.

Does it behave incorrectly when you multiply velocity by 0?

By the character rotating when they jump if you mean that the character is able to turn around in mid-air while jumping then yes.

Where is the actor forward pointing when the character jumps?


Now you only take 2 components into account.


Velocity is multiplied by 100

Obv, do not do that. It would make the projectile fly 100x faster than you’re moving… If you want it somewhat physically accurate and inherit player’s momentum, you’d multi it by 1 * some ThrowStrenght factor.

1 Like

No, I don’t want the mid-air throw trajectory to be physically accurate or to inherit the player’s momentum.

I want the trajectory to always be the same regardless of whether the player character is standing stationary on the ground, jumping through the air or falling downwards.

Don’t add player velocity - because that’s what it does. And if the player somehow rotates, use world axis instead of player orientation.

1 Like

I tried removing the velocity part of the blueprint that I think you were referring to but it hasn’t fix the problem.

What am I missing?

This means the vectors rotate when you jump. Remove one of their components. If not sure how it all works, draw debug arrows to visualise it.

1 Like

I’m not sure what you mean by removing components as removing anything breaks the bomb’s arc trajectory, causing it to be simply dropped in front of the player.

Could you do me a favour, keep the script as is but use this node instead of Add Impulse:

Does is make a difference? Does it seem more like the desired trajectory?

1 Like

That seems to have fixed the problem.

The bomb’s trajectory appears to be same regardless of whether they were thrown from the ground or the air. The bomb’s arc when thrown while jumping off a very high ledge looks a bit off but that might be optical illusion caused by the way that the camera is set-up, otherwise I’m not sure why jumping off a high ledge would change the trajectory versus a normal height jump.

1 Like

This may have something to do with inheriting velocity from the moving player. Perhaps it’s the order of operations in the Detach Bomb function? Simulate first → detach. In this scenario the attached actor would inherit the Pawn’s velocity. You carry the bomb, it has your velocity and then we add to it.

1 Like