Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

FBX model rotates only if AstroMan is visible

ctsholoctsholo
edited October 2016 in Questions And Answers

In Astronaut Tutorial I imported a FBX model and wired up GestureAction to it.
Unchecked AstroMan from GameScene. The result is the newly imported FBX model doesn't respond to rotate gesture. But when I place AstroMan along with it then they both rotate together. Where am I going wrong?

This is the Debug message
Exception thrown: 'System.NullReferenceException' in Assembly-CSharp.dll
NullReferenceException: Object reference not set to an instance of an object.
at Interactible.GazeEntered()
at Interactible.$Invoke1(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
(Filename: Line: 0)

Capability 'internetClient' is required, please enable it in Package.appxmanifest because you're using WWW functionality.

(Filename: C:\buildslave\unity\build\PlatformDependent/MetroPlayer/MetroCapabilities.cpp Line: 126)


Exception thrown: 'System.NullReferenceException' in Assembly-CSharp.dll
NullReferenceException: Object reference not set to an instance of an object.
   at GestureAction.PerformRotation()
   at GestureAction.$Invoke8(Int64 instance, Int64* args)
   at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method) 
(Filename: <Unknown> Line: 0)
Tagged:

Answers

  • @HoloSheep Can you please help me out here?

  • @ctsholo what does your object hierarchy look like after you added another FBX model?

    And what script components have you added to the new FBX model gameobject?

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • @HoloSheep Thanks for replying. I dropped that solution, created a new proj from scratch. dragged and dropped all the Assets from 210 and after adding the manipulation gesture the rotation of the model is working. What do I have to do if I have create an expand model same like AstroMan for the FBX model?

  • @ctsholo sorry I am not sure I understand you new question. Can you rephrase it another way?

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • @HoloSheep Am trying to Expand my FBX model with voice command "Expand Model". So what is the correct way to do it? What I tired was

    • Duplicated my 3Dmodel.fbx and renamed it as 3Dmodel_Expanded in the hierarchy
    • Created Animations for few components of 3Dmodel_Expanded in X,Y,X positions
    • Dragged and dropped 3Dmodel_Expanded into the ExpandModel script of 3Dmodel file.

    Result:- When I say "Expand model" I could hear the "Expand model Audio" but the model is not expanding , where am I doing wrong?

  • @ctsholo said:
    I dropped that solution, created a new proj from scratch. dragged and dropped all the Assets from 210 and after adding the manipulation gesture the rotation of the model is working.

    How did you manage to do that? I am having the same issue - rotates only when the astronaut is visible in the project, but when I tried to start from scratch and add all the required components, it's still not rotating the model.

  • @itsmehuey Hi, I guess you are stuck at Hololens 211 tutorial and Chapter: Navigation right? And I assume you have copied and pasted all the code till Navigation chapter and tried to rotate the Model but it isn't rotating. So I was in this exact stage, so what I did was

    • Continued to next chapter -Chapter 3: hand guidance(I know it is not rotating but still I continued. you can even skip this chapter)
    • Then continued to Chapter 4: Manipulation - did everything exactly like that.
      Voila - After copying the GestureAction code that rotation was working finally :tired_face: *

    P.S: Enable microphone in publish settings so that Move and Expand model commands work. And double check and confirm it in package.manifest file in visual studio under "capabilities" tag. If it is not there then add it manually.

  • @ctsholo I have the same issue to perform rotation on any other 3D objects ? can you please guide me, what should I do after chapter 3 of tutorial 211.

  • @yash_vasa just continue to chapter4 manipulation . after copying and pasting the gesture action script your model will rotate

  • I am in the same situation with not being able to get my model to rotate without the astroman in the scene. I have tried all of the above and not working. New to unity and Hololens. Is there something specific I need to do with importing the FBX file to enable the rotation function?

  • edited February 2017

    I spent a while having the same problem of rotation not working without the astroman and just resolved it. There are a few changes you'll need to make for it to work with a different object from the astro man.

    1. On your custom object go to layers and make sure it is in the Interactible layer. This will make the cursor work correctly with your object. I don't believe the layers were mentioned at all in the tutorial.
    2. You need to modify the GestureAction.cs script. It is taking into account whether or not the astro man is expanded, which you cannot check for once the astroman is gone.
      if (GestureManager.Instance.IsNavigating && (!ExpandModel.Instance.IsModelExpanded || (ExpandModel.Instance.IsModelExpanded && HandsManager.Instance.FocusedGameObject == gameObject))) {
      Change to:
      if (GestureManager.Instance.IsNavigating && HandsManager.Instance.FocusedGameObject == gameObject) {
    3. Also make sure you object has a collider on it.
Sign In or Register to comment.