Set Physics Linear Velocity with Custom Inputs

Hey everyone, hope you all ok during these times,

I have a question/problem,

Despite knowing a tidbit about game development from other engines and have developed a couple of simple games during the last 4 years, I’m completely new to UE and even more at it’s Blueprint system.

I’m trying to set a basic movement system after watching some tutorials, where the player can go forward, backward, sideways and jump. But for some reason it doesn’t work as expected.

This is my blueprint setup for the player to move. The problem is: when I set the Right input, it works fine, the player can go from left to right with no problem, but after setting the Forward input, it doesn’t work (the right input still works but the forward doesn’t, despite being built the same way). If I remove the script for the right input, the forward start to work flawlessly, the same happens if I remove the script for the forward input, the right input get back to working as well. The same goes for the jump. In other words, everytime that I add a new Set Physics Linear Velocity function to add a different movement behaviour, the old ones stop working.

Is something that I’m doing it wrong? I thought each function would be called independetly.

Thanks in advance.

The same goes for the jump. In other
words, everytime that I add a new Set
Physics Linear Velocity function to
add a different movement behaviour,
the old ones stop working.

Is something that I’m doing it wrong?
I thought each function would be
called independetly.

They are called independently - and that’s exactly why you’re seeing the behaviour. By calling Set Linear Velocity, you’re replacing the direction and magnitude of the vector physics movement completely.

Also, do note that Input Axis fires every frame - consider what the above does in this situation. Those nodes still fire even if you do not press the button - but their axis values equal 0 instead. Essentially, when you let go the input, you stop all movement since the vector is multiplied by 0.


It’s not really recommended to Set Linear Velocity unless you’re after a very specific physical interaction. Consider the following:

  • tick Add to Current - this will prevent replacing the vector and add to it instead
  • use Add Force (better choice here) or Add Impulse instead

Hey, thanks man, you saved my day. Thanks for the tips and explanation as well. The reason I was using linear velocity was mostly because I’m trying to create a kind of “gravitional field” that pulls the player towards an spherical object (that is supposed to be a planet where the player can walk around,I have disable the in-engine gravity as well to achieve this). I thought using it would be better to control the vector direction in comparison to Add Force. But I’m not sure if that’s the best approach for this specific case.