I set it up, hopefully correctly? But when I hover over the hotspot, the parameter in Animator just very quickly flickers and then immediately changes back to -1.
Edit: The editor crashed and the project got corrupted. I had to reload from a backup and set this up again. Now, the CursorID parameter does not change at all. The InvenotoryID, Click, and IsOverHotspot work all nicely, so I don't understand why CursorID doesn't react.
My Interaction method is based on a custom script. Checking Single Use Interaction in the Hotspots has sadly zero effect on the parameter :-( But when I switch to Context Sensitive, it works. However, I heavily rely on a custom script (provided kindly by you), as I have a pinch zoom and panning in the game, so I cannot change the Interaction method.
How come the Single Use Interaction is not working in my case?
Thank you, Chris. The cursor ID changes now; unfortunately, when I create a transition in the Animator based on CursorID, the animation from the Default state does not disappear and stays on the cursor while the new animation is played over it.
And second issue; when in menus (I am using Unity UI), the cursor hotspot animation seems to be paused in the middle (menus are set to pause the game). It always moves a bit when I switch between various menu screens. How can I make it interact with menus normally, please?
when I create a transition in the Animator based on CursorID, the animation from the Default state does not disappear and stays on the cursor while the new animation is played over it.
That'll be down to your Animator, and/or the prefab's Hierarchy. AC is only controlling the parameter values, and the cursor's position. Anything else is controlled by the Animator.
And second issue; when in menus (I am using Unity UI), the cursor hotspot animation seems to be paused in the middle (menus are set to pause the game).
Set your Animator's "Update mode" to "Unscaled Time".
Thank you, Chris! Both issues are solved now! I had a copy of the cursor on the scene where I was testing the changes, and I think both the prefab cursor and this scene copy were running at the same time, and that's why I got the doubled animations.
I have an issue with the system cursor appearing over the Unity UI cursor in the built game. I have checked "Replace mouse cursor" in the Cursor Manager, but I am unsure if that has any effect since I am using Unity UI.
Also, during the splash screen, I can see the "thinking" wheel of the windows system cursor.
How can I get rid of both and keep only my Unity UI cursor?
Are any other assets present that may force the display of the cursor? When using Unity UI, AC will disable it (using Cursor.visible), but it's still possible for a separate asset/script to undo this.
Not that I know of. I only have the Unity UI cursor prefab, there is no copy of it in any of the scenes. I didn't do anything with cursors besides this.
It doesn't show anymore. Works for Editor and Build. What does it mean - is something somewhere causing the cursor to reappear, or is it actually missing somewhere where it should be?
How can I implement this globally in the best way? I attached it in an object prefab that spawns within a Global Event. But I ideally need the cursor to stay hidden already during the splash screen.
Windows. I checked the Player setting but didn't find anything there. Somebody online said that turning it off during the splash screen is a paid version feature, but I have no idea if that is true.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HideCursorOnSplash : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
static void OnBeforeSplashScreenRuntimeMethod()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
}
Comments
I set it up, hopefully correctly? But when I hover over the hotspot, the parameter in Animator just very quickly flickers and then immediately changes back to -1.
Edit: The editor crashed and the project got corrupted. I had to reload from a backup and set this up again. Now, the CursorID parameter does not change at all. The InvenotoryID, Click, and IsOverHotspot work all nicely, so I don't understand why CursorID doesn't react.
It's likely an interaction setting.
What's your Interaction method? If not set to Context Sensitive, check Single 'Use' interaction? in the Hotspot to emulate it for that Hotspot.
My Interaction method is based on a custom script. Checking Single Use Interaction in the Hotspots has sadly zero effect on the parameter :-( But when I switch to Context Sensitive, it works. However, I heavily rely on a custom script (provided kindly by you), as I have a pinch zoom and panning in the game, so I cannot change the Interaction method.
How come the Single Use Interaction is not working in my case?
Here is the script in case you need to look at it: https://paste.ofcode.org/37yGCZhDeDhV84QXAUQPC2V
When using Custom Script mode, the option will not have an effect unless your script explicitly allows for it.
Rather than having the Unity UI Cursor control this parameter, clear its Cursor ID int field and attach this script to your cursor prefab:
Thank you, Chris. The cursor ID changes now; unfortunately, when I create a transition in the Animator based on CursorID, the animation from the Default state does not disappear and stays on the cursor while the new animation is played over it.
And second issue; when in menus (I am using Unity UI), the cursor hotspot animation seems to be paused in the middle (menus are set to pause the game). It always moves a bit when I switch between various menu screens. How can I make it interact with menus normally, please?
That'll be down to your Animator, and/or the prefab's Hierarchy. AC is only controlling the parameter values, and the cursor's position. Anything else is controlled by the Animator.
Set your Animator's "Update mode" to "Unscaled Time".
Thank you, Chris! Both issues are solved now! I had a copy of the cursor on the scene where I was testing the changes, and I think both the prefab cursor and this scene copy were running at the same time, and that's why I got the doubled animations.
I have an issue with the system cursor appearing over the Unity UI cursor in the built game. I have checked "Replace mouse cursor" in the Cursor Manager, but I am unsure if that has any effect since I am using Unity UI.
Also, during the splash screen, I can see the "thinking" wheel of the windows system cursor.
How can I get rid of both and keep only my Unity UI cursor?
Is this in a build, or the Editor?
It is in both Editor and Build. Even though the "Show system cursor in Editor" box is unchecked.
Are any other assets present that may force the display of the cursor? When using Unity UI, AC will disable it (using Cursor.visible), but it's still possible for a separate asset/script to undo this.
Not that I know of. I only have the Unity UI cursor prefab, there is no copy of it in any of the scenes. I didn't do anything with cursors besides this.
Place a custom script in your scene with this in its Start function:
Does it still show?
It doesn't show anymore. Works for Editor and Build. What does it mean - is something somewhere causing the cursor to reappear, or is it actually missing somewhere where it should be?
How can I implement this globally in the best way? I attached it in an object prefab that spawns within a Global Event. But I ideally need the cursor to stay hidden already during the splash screen.
If it's showing during the splash scrren, it may be down to a setting in your Player settings rather than AC.
What platform are you building to?
Windows. I checked the Player setting but didn't find anything there. Somebody online said that turning it off during the splash screen is a paid version feature, but I have no idea if that is true.
Ok i beleive i solved it with this script: