blueprint

Paperboy BP_Player Newspapers 210260

  • Exposure: public
  • UE Version: 5.0

TobiyC

January 18, 2023, 4:01 pm

Click the button above, it will automatically copy blueprint in your clipboard. Then in Unreal Engine blueprint editor, paste it with ctrl + v

1 comment

  • TobiyC

    January 18, 2023, 4:27 pm

    This is the blueprint, found within BP_Player, that spawns the Newspaper projectiles at the correct angle. The blueprint is triggered when the Right Shoulder button on the controller is pressed. Firstly, a branch checks if the "Ammo" integer variable is above 0. By default the variable is set to 10. If it is 0, nothing happens, but if it is above 0, a second branch will check the player speed.

    "Player Speed" is a float variable is set to 0.3 by default, and increases the longer forward is held. The first "InRange (float)" node checks if the Player Speed variable is between 0 and 0.3, two very low speeds. If the branch registers as true, it spawns an Actor Projectile. The angle of the Newspaper is determined by the "Spawn Projectile" arrow component reference. In the viewport for the player, there is are three arrows, each at different angles, that correspond to the three Newspaper angles. "Spawn Projectile" is the first one, which results in the Newspaper being spawned at a -85 degree angle.

    If the second branch registers the Player Speed as not being between 0 and 0.3, it will progress to a third branch, this time determining if the player speed is between 0.301 and 0.7. If this is true the Newspaper will be spawned based on "Spawn Projectile 2", which is at a -70 degree angle. (Forgive the weird numbering order.)

    If the branch registers the Player Speed as not being between 0.301 and 0.7, it will progress to a fourth branch, this time determining if the player speed is between 0.701 and 10. If this is true the Newspaper will be spawned based on "Spawn Projectile 1", which is at a -55 degree angle. (Forgive the weird numbering order.)

    All three of these end up feeding into the "Set Ammo" node, which decreases the number in the Ammo integer variable by 1.