Saving player velocity; applying impulse

Hi all,

I’m having a weird occurrence where I record the velocity of a moving player; they respawn; and I apply an impulse using the recorded velocity as the directional value.

The issue is, when this happens, the direction of the impulse doesn’t line up with the original vector. For example, when moving in the positive X direction when the velocity is recorded, the impulse sends you in the negative z direction. I’m really confused as to why.

It seems that, whenever moving in the z direction, the movement is rotated about the vertical axis by 270°

Not sure how to write code, so here’s what I’ve done:

Rule #1
Pressing interact sets a player variable (“V”) to the velocity of the player; then the player is forced to and from a different hero.
Rule #2
Wait time of 2 seconds
Apply impulse to event player
Direction - player variable “V”
Speed - player variable “V”
Relative - to player
Motion - cancel contrary motion

I look forward to your responses

Edit:
When setting relativity to the world, moving in the negative directions for X and Z would later propel me in the positive directions for each axis respectively. It is as if a modulus is being take of the vector before being implemented

Velocity is a world vector, so you need to also set the relativity in the Apply Impulse action to To World.

1 Like

When I did this, when moving in the negative directions for X or z, I was always propelled in the positive direction later

Velocity is a local vector, the direction that you apply impulse to world is relative in world coordinates.

If you wanna apply impulse to player facing u must use Relative To Player