When I pause my game I get that warning popping up. I don’t know if it’s even worth fixing as the game itself works fine. Here’s my code (that matters):
if (Input.GetKeyDown(KeyCode.Escape))
{
if (pauseMenuOpen == false)
{
audio.PlayOneShot(clickSound);
playerPosX = player.transform.position.x;
playerPosY = player.transform.position.y-.4;
playerPosZ = player.transform.position.z;
OpenPauseMenu();
pauseMenuOpen = true;
}
function OpenPauseMenu () {
player.GetComponent(CharacterController).enabled = false;
Time.timeScale = 0;
Screen.lockCursor = false;
player.transform.position = Vector3(playerPosX, playerPosY, playerPosZ);
}
If i don’t turn off the character controller and the player is moving and pauses the game it returns null values for some variables and nothing seems to fix it. The “playerPosX” variables are used to set the position of the player because unity seems to lose track of the object and assigns it a y position than what it was previously at when i turn off the character controller.
If anyone knows how to fix the CharacterController.Move called on inactive controller
UnityEngine.CharacterController:Move(Vector3) problem without completely reworking my code it would be greatly appreciated. If there is no solution, is it bad to have the constant warnings like it’s giving me?
Thanks