PlayerMultipliers
Updated in 1.3.6
PlayerMultipliers can be used to create custom Power-Ups.
damageMultiplier: Used by WeaponController to determine Damage Power-Up.
healMultiplier: Used by the PlayerStats to determine Heal Power-Up.
playerWeightMultiplier: Used by PlayerMovement to determine Weight Power-Up
HOW TO CREATE CUSTOM MULTIPLIERS / POWER-UPS.
First, we need to add a new variable in PlayerMultiplier.cs
. We'll name it playerSpeedMultiplier
. Keep in mind that creating custom multipliers or power-ups can be very specific, so this tutorial will not cover the exact steps or requirements for your case.
To define the default value for playerSpeedMultiplier
, set it to 1, since it acts as a multiplier (i.e., currentSpeed * playerSpeedMultiplier = currentSpeed
when playerSpeedMultiplier
is 1).
For a variable like playerSpeedAddition
, which represents an additive value, set its default to 0. This ensures that currentSpeed + playerSpeedAddition = currentSpeed
when playerSpeedAddition
is 0.
Now, let's determine the default value for this new variable.
Locate the section in your code where a multiplication operation is required for your Custom Power-Up to function. Use your custom multiplier by referencing the PlayerMultipliers
script.
PlayerMultipliers.cs can be found inside the same script.
Last updated