Download

Projectile bounces to Z axis only when it's set to bounce to Y and Z axes

I’ve just started to learn Unreal Engine and I’m developing a Pong clone game using Blueprint only.

I have a Ball class with this OnHit method:

There are three nodes on the right side of the screen that you don’t see. They are print nodes to see ReflectedVelocity Values:

LogBlueprintUserMessages: [BP_Ball_C_0] X=0.000 Y=190.000 Z=190.000
LogBlueprintUserMessages: [BP_Ball_C_0] X=0.000 Y=134.350 Z=-134.350
LogBlueprintUserMessages: [BP_Ball_C_0] X=0.000 Y=-190.000 Z=190.000
LogBlueprintUserMessages: [BP_Ball_C_0] X=0.000 Y=-134.350 Z=-134.350
LogBlueprintUserMessages: [BP_Ball_C_0] X=0.000 Y=0.000 Z=-190.000

I’m using a ProjectileMovement component to move the ball.

There are two edges on top and bottom of the screen, and two paddles on the right and left of the screen.

When the ball hits on any of the edges it always bounces on Y and Z axes, but when it bounces to a paddle, 90% of time it bounces on Y and Z axes but sometimes, when the ball hit on a paddle, it does not matter which one, it bounces moving only on Z axis (Y axis value is 0.0).

These are the properties of ProjectileMovementComponent:


Why is this happening?