Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Feature Request Additional Camera Criterion

Discussion in 'In-Editor Tutorials Packages' started by WhipJr, Apr 28, 2021.

  1. WhipJr

    WhipJr

    Joined:
    Aug 3, 2011
    Posts:
    125
    Hello! Just want to start out by saying this is a fantastic addition to Unity and as a Professor, it's going to change everything about how I teach Unity. Thank you!

    At the moment, I'm working on a basic interface tour where each main window of the interface is highlighted, described and interacted with in a common manner of how it would normally be interacted with. That being said, the current interaction I am attempting to create has the student clicking the top "arm" of the compass gizmo in the Scene View to illustrate top-down view. This will then advance to learning the difference between Orthographic and Perspective views.

    I've programmed a hacky way to check for this top-down interaction, but it requires me to keep track of the camera used for the Scene View. The issue is that I have to access Camera.current which can return null if the scene view is not active. To bypass this, in a previous step I have the student click in the scene view to set it to active which then sets my Camera variable for use later. This step is then automatically advanced.

    It seemed odd to me that this interaction was not innately built into the SceneViewCameraMoved Criterion as well as the checks for Orthographic/Perspective/2D views.

    Lastly a small observation; in storing the camera variable, if the user clicks 'next' before the auto advance triggers, sometimes the camera variable is not set correctly. (I fixed this by using SceneView.lastActiveSceneView.camera so either way it grabs the correct camera, but I digress)

    If possible, it would be nice to add the ability to remove/disable the next button if auto advance is on to allow more control over how the content is progressed through. After the auto advance progresses to the next page, the setting for the auto advance page could then reenable the ability to hit next in case the user wanted to go back to review content without hitting a dead end with the button removed/disabled.


    TLDR; more built-in options to the SceneViewCameraMoved Criterion && ability to disable the next button on pages that have Auto Advance enabled
     
  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hi @WhipJr , thanks for your feedback and for using IET!

    If you add any criteria to a Tutorial Page, the next button won't be interactable until all/any (depending on the settings of said tutorial page) are completed. This should solve your problem.

    Did you try using SceneView.Camera instead ? If that doesn't work, you could also focus the SceneView from code like displayed here, using a custom callback.

    Understandable. Anyway, regardless of what is available, you can implement any criterion using ArbitraryCriterion, as displayed here in the Defining your own completion criteria section. Doing so should solve your problem!
     
  3. WhipJr

    WhipJr

    Joined:
    Aug 3, 2011
    Posts:
    125
    The issue was that the criteria was complete, but if the user clicked out of the scene view before the Auto Advance had the chance to move to the next page, the variable was overwritten with a null value.

    I was looking for a way to do that! Thank you!


    [/QUOTE]
    I do currently have the ACs set up, it allows for a lot of unaccounted for instances like mine listed above.

    Thank you for your reply and input! :)
     
  4. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Great! I hope that helped :D