- Home /
How do I disable FPS controls and MouseLook controls and Start Getting Mouse Coordinates?
At a certain time in my game, when the player goes to some place and touches something, i want his FPS controls( Keys W A D S) and the Mouselook movement(typical of FPS games) to be disabled.
And at that point i want the mouse to get the 2D (x and y) coordinates of the screen.
And then of course, i want to renenable FPS controls and MouseLook when user gets away from that place.
How do i do this?
For my fps game i use FPSInput script(included in unity) and MouseLook script(included in unity)
Answer by DESTRUKTORR · Sep 04, 2013 at 12:01 AM
Look here. Alternatively, I'd suggest getting those components as field variables, and just disabling them within a method or function, like this:
// C#
void DisableFPS()
{
fpsInput.enabled = false;
mouseLook.enabled = false;
}
//Javascript
function DisableFPS()
{
fpsInput.enabled = false;
mouseLook.enabled = false;
}
Your answer
Follow this Question
Related Questions
How do i get the cursor to stay in the center of screen for fps!? 1 Answer
aiming with animation 1 Answer
[Noobhelp] Need help with mouselook on a Fps 1 Answer
Fps Aiming Script help 2 Answers
Making an underwater game 1 Answer