πŸ“—
Padlock System - Doc
  • Padlock System - Introduction
  • ⭐Getting Started
    • Quick Start
    • Detailed Setup
  • ❓Support
    • FAQ
    • Unlock Event
    • Yellow Warnings?
    • Input Locations
    • Adding Audio Clips
    • Adding Trigger Event
    • Changing Materials
    • System Namespace
    • Changing Character Controller
  • πŸŒ€Development
    • Patch Notes - V1.6
    • Roadmap
  • πŸ“§Contacts
    • Contact Me
    • My Other Assets
Powered by GitBook
On this page

Was this helpful?

  1. Support

Changing Character Controller

When we interact with the padlock we disable character movement and camera rotation. In the DisableManager script we reference the player controller so we can disable the FirstPersonController script.

NOTE: If you’re using a different controller please replace these lines with appropriate for you, as can be seen below from the comments. Create a new reference to your character controller and disable movement and camera rotation for your controller.

public class PLDisableManager : MonoBehaviour
    {
        [SerializeField] private FirstPersonController player = null; //EDIT THIS
        
        public void DisablePlayer(bool disable)
        {
            if (disable)
            {
                player.enabled = false; //EDIT THIS
                //OTHER LOGIC
            }

            else
            {
                player.enabled = true; //EDIT THIS 
                //OTHER LOGIC
            }
        }
    }
PreviousSystem NamespaceNextPatch Notes - V1.6

Last updated 1 year ago

Was this helpful?

❓