top of page

Functions

MPM features two main blueprints:

  • BP_MagneticObject_Master

  • BP_Container

​

Both of these blueprints contain functions both for reusability and organisation purposes.

​

In this section we will walk through each of the functions with a short explanation of what it does.

Magnetic Object

In this section we will walk through each function used in BP_MagneticObject_Master.

bpmaster.png
masterfunctions.png

Find Closest Player:

Finds the closest player relative to this pickup.

​

Get Player Distance:

Get the current distance to the targeted player.

​

Move To Player Physics:

This function adds the force to the pickup.

​

Calculate Force:

Calculates the force that should be applied to the pickup.

​

Check Line Of Sight:

Checks if the pickup has a line of sight with the player.

​

Magnetize:

This enables and disables a pickup for magnetization during runtime.

​

Check Players In Range:

Checks if the amount of players in range is greater than zero.

​

Pickup:

Handles the event of the player picking up a pickup.

This is where you implement all functionality regarding to the player picking up and object.

​

New Player In Range:

Initiates the pickup logic when a player gets in range.

​

Player Out Of Range:

Subtracts one from the amount of players in range when a player leaves the pickup range.

​

Despawn Check:

Checks if the pickup has been alive for long enough to despawn.

Container

Spawn Item And Add Impulse:

This funcions runs every loop iteration. Once called, this function gets a random item from the specified spawnable items and spawns it, then adds an impulse to make it fly out of the container.

In this section we will walk through each function used in BP_Container.

containerfunctions.png
bottom of page