Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: Lane on March 05, 2015, 12:18:33 PM
-
Unity 5 depreciates some code for Set Mouse Cursor and handles Cursors a bit differently. This should meet your needs when replacing the Set Mouse Cursor action.
I've had some mixed results with the Cursor visibility, so please report any problems with the action along with relevant hardware/software info.
-
Thank you, I came in here today looking for this very thing!!
-
I used Set Mouse Cursor with Set Mode cursor and I have some problem with any scene. For example, it's doesn't works in main scene but it's ok for other scene.
-
It seems there are some issues with the new cursor stuff in Unity 5, but no one has tracked them down yet.
-
Sorry to be a noob, but how would one apply the workaround? I've tried adding the script to my character controller but it is telling me it needs to be dreived from a Monobehaviour.
Thanks,
-
Just drag it into your project folder and it'll appear in the Playmaker Action List.
-
Thanks so much for this Lane!
-
I am using this action, but when I test it in the editor, the cursor will jump to the pause button or to the center of a different window in the editor whenever it hovers over an object with a Mouse Pick Event action (at least that seems to be the reason). Any ideas?
-
Hmm, not really.
There seem to be some problems with the new way Unity handles cursor locking and there isn't much documentation even still. I assume its an issue with varying hardware because not everyone exhibits the same issues, or any issues at all. Often this works just fine so its kind of hard to figure out whats wrong but it doesn't seem to be related to the action from what I can tell and have read on the Unity forums.
-
Ok, I found that it is actually when I go to my reset state on mouse off, it sends an event to my cursor fsm to set it back to default. I have things set up very similar to the "No Exit" Playmaker example. I will also try opening the project on a different machine in case it's a hardware issue. Thank you for the quick response ;D
-
Yeah, it seems to be hardware related. I will try it on a another PC tonight to be sure, but everything worked perfectly on mac. There was another issue that I have been having with the cursor that didn't seem present on the mac. Thank you for the help.
-
So I tried it on another PC and I was having the exact same problem, but it may be a combined issue with the cursor not behaving properly. This is when I test the game in windowed mode in the editor; it seems to work fine in full screen. I have found some posts online about some people having issues with the cursor in Unity 5 on PC.
-
Interesting, thanks for following up.
-
Unity 5.1.1 released with a cursor fix for Windows I believe.
-
Unity 5.1.1 released with a cursor fix for Windows I believe.
I glanced through the patch notes but haven't found anything on it, still seems to be acting up for me.
-
I'm using unity 5.1.1p4 with windows 8.1.
On the main menu (capture.jpg), it is set to change to a ball and turn. It does this fine.
When clicking on a button and going to another scene, the cursor locks up. It gets confined to the center of the screen. I have to pause the game, then unpause the game to get the cursor moving again. I have tried the different settings on the action and it still freezes the cursor (like the lock mode).
the 'hide cursor' setting is a bit deceiving. Does this mean if checks it hides it? or does it mean 'see the cursor'.
-
Toggle fields are always boolean; the statement is true when checked and false when unchecked.
Not sure whats up with the changing scenes issue.
-
Lane, this action is not working on Unity 5.2.2f1. I tried on 3 different computers and got no results as the mouse kept going off the game screen and losing focus when the mouse button is pressed. I found this script here and it is working: http://answers.unity3d.com/questions/913318/lock-cursor-problem-in-unity-3d-5.html
using UnityEngine;
using System.Collections;
public class HideLockCursorA : MonoBehaviour
{
void Start ()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
void Update ()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
}
I hope this can help others!
-
The link to the Answers thread shows some using it in Update, but that doesn't work for me. Seems like most people are still finding it buggy.
Try this one. It's got a few options, at least you can narrow down which update types work. Seems to work only in OnGUI with the system I'm on right now.
FYI the original was only firing Once. The UpdateType dropdown gives you the option of firing in a Update, OnGUI, LateUpdate or only Once.