Using a different Character Controller

How do I use a different character controller with this system?

In the β€œDisableManager” script we reference the player controller so we can disable the β€œFirstPersonController” script.
When we interact with the object we disable character movement and camera rotation. If you’re using a different controller please replace that reference with the way to disable your controllers movement and camera rotation!
My example scene has a variable called "FIrstPersonController player = null" - This is reference the "FirstPersonController" script and we give it the name of "player".
You can change "FirstPersonController" to your controller and how you would like to disable the camera movement and player movement.
public class ExamineDisableManager : MonoBehaviour
public static ExamineDisableManager instance;
[SerializeField] private Image crosshair = null;
[SerializeField] private FirstPersonController player = null;
[SerializeField] private ExamineRaycast raycastManager = null;
[SerializeField] private BlurOptimized blur = null;
In the snippet below, we can disable the player and camera movement by setting "player.enabled = false" because this will disable the "FirstPersonController" script which controls both the player movement AND camera movement. This is where you would change those two statements accordingly!
If you have any issues at all, do send me an email! :)
public void DisablePlayer(bool disable)
if (disable)
raycastManager.enabled = false;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
blur.enabled = true;
crosshair.enabled = false;
player.enabled = false;
raycastManager.enabled = true;
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
blur.enabled = false;
crosshair.enabled = true;
player.enabled = true;
Copy link