Scene/situation planFirstPersonPlayer walks up to a screen, Hits use and i get the popUp of the screen on the UI, player types something then clicks save, and walks away!
ToolsI'm using NGUI,Playmaker, NGUI scripts for PlayMaker.
FirstPerson controller from Unity standard assets.
What is working as intendedI walk up, get the 'press use button' and the pop up shows just fine,
when i cancel by walking away or exiting it closes just fine.
ProblemWhen the NGUI popup is active i want to disable "mouseLook" component in the player asset. Then enable normal mouse use.
And then ofcourse by cancelling disable mouse/re enable mouselook on the player.
Considerations If i where scripting this, i would maybe edit the player script itself to include something like this..
void Start ()
{
noMouse = GetComponent<Mouse look>();
}
void Update ()
{
if(Input.GetKeyUp(KeyCode.E))
{
noMouse.enabled = !noMouse.enabled;
}
}
But then it could actually enable or disable when it should not,
so I'm trying to work this in from playMaker on the computer itself.
I was considering maybe use playmaker on the computer to set a globalVar and maybe add FSM to player just checking that globalvar constantly
The Computer
The Player component i want to change state on.
SolutionWell I'm not sure where to start to achieve this, so that's basically why I'm here.
Open to suggestions or better solutions to the same porblem.
Vaupell
EDIT ADD : Just realized this is the same thing you would want to do
if you where to have a Ingame options menu.
ie. Hit esc/pause and being able to use the mouse there.