Page 3 of 3
Re: Show/Hide mouse on ESC for menu
Posted: Fri Apr 29, 2016 10:01 am
by supadupa64
Yeah I deleted the folders before I imported the source code. I got errors doing it the suggested way with like 1-2 fps.
Re: Show/Hide mouse on ESC for menu
Posted: Fri Apr 29, 2016 10:06 am
by Tony Li
If something is spamming the Console with debug lines, it'll kill your fps. If you want to pursue it, please post a sample of the debug lines here. Otherwise we can pick it up again when TPC 1.3 comes out.
Re: Show/Hide mouse on ESC for menu
Posted: Fri Apr 29, 2016 10:09 am
by supadupa64
It's not a big deal right now since it's basically figured out. It's not happening anymore since I reverted back to the original files atm.
Re: Show/Hide mouse on ESC for menu
Posted: Sat Jul 09, 2016 4:35 pm
by supadupa64
I think it's all figured out now. I installed all current versions of DS and TPC and the new hide/show cursor for TPC update still doesn't work. But, I did use this script that someone else made that solved the hide/show cursor situation! It Works perfect! I just unchecked the "Disable with Escape" box from TPC and used this script below and placed it on my player. Anyone else having this same problem can use this to fix it! =)
using UnityEngine;
using System.Collections;
using Opsive.ThirdPersonController;
using UnityEngine.UI;
public class CursorLock : MonoBehaviour
{
bool cursor = true;
void Update ()
{
//Cursor key toggle
if (Input.GetKeyDown(KeyCode.Escape))
{
if(cursor == true)
{
Cursor.lockState = CursorLockMode.None; //unlock cursor
Cursor.visible = true; //make mouse visible
EventHandler.ExecuteEvent(gameObject, "OnAllowGameplayInput", false); //disable TPC input
}
if (cursor == false)
{
Cursor.lockState = CursorLockMode.Locked; //lock cursor
Cursor.visible = false; //disable visible mouse
EventHandler.ExecuteEvent(gameObject, "OnAllowGameplayInput", true); // allow TPC input
}
cursor = !cursor; //switch cursor boolean.
}
}
}
Re: [SOLVED] Show/Hide mouse on ESC for menu
Posted: Sat Jul 09, 2016 9:28 pm
by Tony Li
Thanks for posting your solution. I'll compare this script to the Dialogue System's bridge script and make updates if necessary.