This function unlocks physics character controller. In this case, you can move the main game character or the camera attached to it using the keyboard or mouse.
function OnSelectMouseLButtonDown() LockCharacterController() end function OnSelectMouseRButtonDown() UnlockCharacterController() end function OnSelectMouseEnter() end
Assume that the above script is attached to a button object. Whenever you left click on this button, the main character will be locked. Whenever you right click on this button, the main character will be unlocked.UnlockCharacterController