Search Unity

Question Recorder not capturing mouse-cursor (despite me via code setting it as enabled)

Discussion in 'Audio & Video' started by HuldaGnodima, Oct 18, 2021.

  1. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    Hi!

    As per the title, no matter what I do I can't seem to get the recorder to capture my cursor (custom or default).
    I found this thread (2017): https://forum.unity.com/threads/unity-recorder-update.509458/page-2#post-3503657

    It's suggested that the cursor will be captured if you follow these two steps:
    1. Via code enable cursor (swhich I have done):
    Code (CSharp):
    1.     void Start()
    2.     {
    3.         //Set Cursor to not be visible
    4.         Cursor.visible = true;
    5.     }
    2. Set the collection method to Game
    It seems that newer versions of the recorder don't have the same options, but I put the "Source" option to "Game View". These are my settings:

    upload_2021-10-18_12-18-44.png

    But none of this is working. My recorded videos still do not have the mouse cursor in them. Is there anyone who knows how to enable it? I've googled and can't find anything more recent than the 2017 thread I linked above.

    Thanks in advance!
     
  2. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    189
    Hey,

    I was able to have a custom cursor get recorded successfully in a GameView with the following code:
    Code (CSharp):
    1.     public class blah : MonoBehaviour
    2.     {
    3.         void Start()
    4.         {
    5.             var tex = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/tex.png");
    6.                 Cursor.SetCursor(tex,new Vector2(0.5f,0.5f), CursorMode.ForceSoftware );
    7.         }
    8.     }
    I tried both HDRP and legacy pipeline under unity 22.1 with recorder version 4.0

    Were you able to see your cursor move successfully in the game view ?

    PS: This is a nifty feature I was not aware of inside Unity :)


     
  3. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    First of all your avatar is adorable, I love it!
    Second, thank you so much for looking into this.

    When you mentioned it working for you on HDRP (and legacy pipeline) I became suspicious, becuase I'm also using the HDRP but together with the 2D Renderer - Experimental. Thought it might be that so I tried swapping out the 2D renderer for a regular Renderer, but it's still not recording the mouse cursor. I'm on Unity version 2020.3.20f1.

    Would you mind screenshotting your movie-settings? Maybe I'm missing something?

    I've seen youtube comments on Unity Recorder tutorials that are just a week - 6 months old of people not being able to record the mouse. So I think I might not be alone. Could it be a bug?

    Thanks so much in advance! Hope we'll find a solution

    //Hulda
     
  4. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    189
    There's really nothing special: a default movie recorder.
    I've done it in an empty HDRP project (it's actually a legacy project converted into HDRP using the Wizard):
    Screen Shot 2021-10-18 at 1.32.50 PM.png
     
  5. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    Thank you! Looks like we have the same settings at least.
    I tried it in another project and it also isn't recording in that one.

    I'm going to try to make a completely new project and get back to you to see if it works! Thanks for your patience.

    EDIT: If that doesn't work maybe I can PM you my build, and you can see if the project records the cursor on your system? Only if that is OK for you, maybe that will give a clue!
     
    Last edited: Oct 18, 2021
  6. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    151