Adding an Impulse UE5
We are going to be making our actors move upon request. So if we hit the space bar our cube will hop up.
We are going to be adding a force to our cube. We are going to go into our Level blueprint and right-click and type space bar. This will allow us to act when the space bar is pressed and released
We are going to attach our execution pin to the print string that gives us our mass from the last tutorial. When we press play and press the space bar our mass is printed to the screen.
We are going to duplicate our cube static mesh component in the blueprint and right-click and add an impulse and connect our pressed space bar.
We are missing a few pieces still. We can add in a value to Z to tell our cube to go up. We are going to add a float variable of 100 and multiply it times 100000 and connect it to our Z value by splitting the pin our impulse.
Force = Mass * Acceleration
Impulse = Mass * Velocity Change
If I want to change the velocity there is a checkbox at the bottom of the add impulse section and add the mass entirely and applies the velocity.\
If I had changed it to the X or Y it would have gone that direction instead of up.