FPS ENGINE DOCUMENTATION
  • Welcome to FPS Engine!
  • BEFORE WE START
    • Early Considerations
    • List of Tutorials
    • List of Add-Ons & Compatible Packages
  • GETTING STARTED
    • 01. Basic set-up
    • 02. Roadmap
  • CONTENT
    • 03. Content
      • 03.1 CAMERA
        • MoveCamera
        • CameraFOVManager
      • 03.2 MOVEMENT
        • PlayerMovement
      • 03.3 PLAYER
        • PlayerStats
        • PlayerMultipliers
        • PLAYER STATES
          • PlayerStates
          • PlayerBaseState
          • PlayerStateFactory
        • WEAPON STATES
          • WeaponStates
          • WeaponBaseState
          • WeaponStateFactory
        • Player Debugging
      • 03.4 WEAPONS
        • Weapon_SO
        • WeaponIdentification
        • WeaponController
        • Bullet
        • ATTACHMENTS
          • Attachment.cs
            • Barrel.cs
            • Flashlight.cs
            • Magazine.cs
            • Scope.cs
            • Stock.cs
            • Laser.cs
            • Grip.cs
          • AttachmentIdentifier_SO.cs
      • 03.5 PICK UP SYSTEM
        • InteractManager
        • Interactable
        • Item_SO
        • Identifiable
        • Pickeable
          • WeaponPickeable
          • BulletsPickeable
          • AttachmentPickeable
      • 03.6 ENEMIES
        • IDamageable
        • EnemyHealth
        • TrainingTarget
        • CIrcularTargetEnemy
        • Turret
        • TurretProjectile
      • 03.7 EFFECTS
        • CameraEffects
        • CamShake
        • CrouchTilt
        • JumpMotion
        • ProceduralShot
        • ProceduralShot_SO
        • WeaponEffects
        • WeaponSway
      • 03.8 UI
        • CowsinsButton
        • Crosshair
        • CrosshairShape
        • Hitmarker
        • UIController
        • UIEvents
        • RebindUI
      • 03.8 EXTRA
        • Checkpoint
        • Coin
        • Compass
        • CompassElement
        • Destructible
        • Crate
        • ExplosiveBarrel
        • PowerUp
        • DamageMultiplier
        • HealMultiplierPowerUp
        • Healthpack
        • DoorInteractable
        • Experience
        • GetGameInformation
        • HurtTrigger
        • JumpPad
        • Lootbox
        • PauseMenu
        • PointCapture
        • Trigger
        • DraggableButtonInSceneView
        • UTILITIES
          • DestroyMe
          • IgnoreCollision
          • LookAt
          • CowsinsUtilities
      • 03.09 MANAGERS
        • CoinManager
        • ExperienceManager
        • GameSettingsManager
        • InputManager
        • SoundManager
        • PoolManager
  • HOW TO USE
    • Getting Started: First Steps
    • Importing FPS Engine into URP / HDRP
    • Add a Player Controller
    • Adding New Weapons
    • Saving & Loading Presets
    • Changing Keybindings
    • Creating New Pickeables
    • Controllable & Not Controllable Player
    • Adding New Surfaces ( Grounds )
    • Working with Attachments
    • Modify Weapon and Camera Effects
    • Adding Custom Key Rebinds
    • Add breakable (Destructible) objects
    • Custom Shot Weapons
    • Adding Enemies
  • FAQ
    • FAQ
  • SUPPORT
    • Support
Powered by GitBook
On this page
Export as PDF
  1. CONTENT
  2. 03. Content
  3. 03.3 PLAYER

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.

 [ReadOnly] public float playerSpeedMultiplier;

NOTE: You can use ReadOnly to display the value in the Inspector for easier debugging, while keeping it unmodifiable ( from the Inspector, keep in mind this variable is public and can be modified programmatically )

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.

 private void Awake()
 {
     damageMultiplier = 1;
     healMultiplier = 1;
     playerWeightMultiplier = 1;
     // Our new variable
     playerSpeedMultiplier = 1;
 }

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.

PreviousPlayerStatsNextPLAYER STATES

Last updated 2 months ago

If you need assistance, feel free to reach out for !

support