💨
Gas Mask System - Doc
  • Gas Mask System - Introduction
  • ⭐Getting Started
    • Quick Start
    • Detailed Setup
  • 📖Manager Defaults
    • GMController
    • UI Manager
    • Health Manager
    • Audio Manager
    • Input Manager
  • ❓Support
    • Frequently Asked Questions
    • UI Text Missing
    • Where are inputs located?
    • Post Processing Errors?
    • FPSController Editing
    • PostProcessing Editing
    • Audio ScriptableObjects
    • System Namespace
  • 🌀Development
    • Patch Notes - V1.5
    • Roadmap
  • 📧Contacts
    • Contact Me
    • My Other Assets
Powered by GitBook
On this page
  • The FPSController Variables
  • Editing the GMController script
  1. Support

FPSController Editing

The FPSController Variables

The included FPSController is from the Unity Standard Assets, and I have edited the variables in that script to make sure they're accessible in the "GMController" - So they can be easily edited and modified when you enter and exit the gas to slow the player. See below on the variables that should be public or set them in set them in such a way that they're accessible in your controller.

namespace UnityStandardAssets.Characters.FirstPerson
{
    [RequireComponent(typeof (CharacterController))]
    [RequireComponent(typeof (AudioSource))]
    public class FirstPersonController : MonoBehaviour
    {
        [SerializeField] private bool m_IsWalking = false;
        public float m_WalkSpeed;
        public float m_RunSpeed;
        [SerializeField] [Range(0f, 1f)] private float m_RunstepLenghten = 0.14f;
 

Editing the GMController script

In the "GMController" script you will find a method called "PlayerMovement" you can edit this along with the "walkGas, runGas, walkNorm, runNorm" variables in this script to change the values of the FPSController. Even edit this method if you want to incorporate your own controller.

void PlayerMovement(bool slowPlayer)
        {
            if (slowPlayer)
            {
                player.m_WalkSpeed = walkGas;
                player.m_RunSpeed = runGas;
            }
            else
            {
                player.m_WalkSpeed = walkNorm;
                player.m_RunSpeed = runNorm;
            }
        }
PreviousPost Processing Errors?NextPostProcessing Editing

Last updated 1 year ago

❓