Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to Record mouse cursor using Unity Recorder?

Discussion in 'Audio & Video' started by HuldaGnodima, Apr 30, 2021.

  1. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    Hi!

    I love the Unity Recorder, the only issue for me is that it for me right now isn't capturing the cursor.
    Does anyone know how to get the recorder to include the cursor?


    I found an old thread that said to put the collection method to "Game" but I don't have that option in the Recorder-menu in Unity 2020.3.6f. (LTS). I also added the script the unity-employee in the thread wrote one could try to add the mouse. I added the script to a gameobject that runs on start, but it's not making the recorder record the mouse either.


    Does anyone know how to go about? I've found no other resources on this.
     
  2. MontblackJJ

    MontblackJJ

    Joined:
    Jul 22, 2020
    Posts:
    5
  3. PlainsTunneler

    PlainsTunneler

    Joined:
    Dec 25, 2019
    Posts:
    1
    Cursor.SetCursor() didn't work for me. Hopefully I'm doing something wrong. I've found no other resources too. @HuldaGnodima let me know if you've found any solution please.

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.     using UnityEditor;
    3. #endif
    4.  
    5. public class cursorVisible : MonoBehaviour
    6. {
    7.     void Start()
    8.     {
    9.         #if UNITY_EDITOR
    10.             Cursor.SetCursor(PlayerSettings.defaultCursor, Vector2.zero, CursorMode.ForceSoftware);
    11.         #endif
    12.     }
    13. }
     
    PharmacyBrain and keithlau2015 like this.
  4. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    I actually didn't manage to get it to work unfortunately. Eventually I stopped looking for a fix. But I would love to get it to work, I'll have a look around again. If you find a solution, please share. I will absolutely do the same!
     
    PlainsTunneler likes this.
  5. PolygonPros

    PolygonPros

    Joined:
    Apr 11, 2020
    Posts:
    34
    I'm having the exact same problem. Was a fix finally found for this?
     
  6. yqiazkv

    yqiazkv

    Joined:
    Nov 11, 2022
    Posts:
    2
    I am experiencing the same thing. In the first place, I can also check if my mouse is working properly. After that, I'll track my mouse.
     
  7. thecapitankaty

    thecapitankaty

    Joined:
    Nov 21, 2020
    Posts:
    11
    unity has a recorder
     
  8. guron_san

    guron_san

    Joined:
    Jun 11, 2023
    Posts:
    1
    Code (CSharp):
    1. #if UNITY_EDITOR
    2.     using UnityEditor;
    3. #endif
    4.  
    5. public class cursorVisible : MonoBehaviour
    6. {
    7.     void Start()
    8.     {
    9.         #if UNITY_EDITOR
    10.             Cursor.SetCursor(PlayerSettings.defaultCursor, Vector2.zero, CursorMode.ForceSoftware);
    11.         #endif
    12.     }
    13. }
    Set cursor texture by the Player settings window (default texture is None), I could record the cursor.
     
  9. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    151
    Unfortunately not working for me. Once I set "CursorMode.ForceSoftware" I don't see cursor at all in the Game view. If changed to "CursorMode.Auto" I see my custom cursor, however it is still not recorded by Unity Recorder.
    Unity 2022.3.8, HDRP, Unity Recorder 4.0.1

    UPDATE: CursorMode.ForceSoftware doesn't work with New Input System.
     
    Last edited: Jan 14, 2024
  10. Caparrini

    Caparrini

    Joined:
    Jun 21, 2017
    Posts:
    66
    I'm also interested on how to do this to capture UI interactions.
     
  11. oorjatech

    oorjatech

    Joined:
    Jan 15, 2016
    Posts:
    3
    Just provide a texture instead of PlayerSettings.defaultCursor, It worked for me...