blueprint

Gravitar Ship Rotation

  • Exposure: public
  • UE Version: 5.0

EmilsMozga

December 12, 2022, 8:28 pm

Player's ship rotation blueprint.

Section explanations:

Input Booleans - Action input checks that, when pressed, set a Boolean to true, and when released, set it to false. These are done separately for turning left and right, named IsTurningLeft and IsTurningRight respectively.

Set RotationSpeed depending on turning direction - I determine the turning direction by comparing the values of both input Booleans in this equation:

IsTurningLeft > IsTurningRight

So, if the Boolean IsTurningLeft is true and IsTurningRight is false, the equation is:

1 > 0;

This equation returns true, meaning that the ship is turning left, which routes the blueprint path to a node setting RotationSpeed to a value that will rotate left. And of course, if the values were swapped, the equation would return false, which would route the path to a node that will set RotationSpeed to an opposite value. In the case that the equation would normally return false because of both values being equal - the event for it is only triggered when either one input or the other is pressed, otherwise the RotationSpeed value is set to 0.

Check if player is turning, executes rotation with RotationSpeed - self-explanatory.

Click the button above, it will automatically copy blueprint in your clipboard. Then in Unreal Engine blueprint editor, paste it with ctrl + v
Versions
January 10, 2023
  1. Added a new variable RotationSmoother that is responsible for a very subtle rotational acceleration, so that the rotation speed is not linear, just like in the original.

December 12, 2022
  1. First commit

    See