Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. And always feel free to hit us up on Twitter @MxdRealityDev.

How to share Status of a Hologram?

Hi there,
For my project I need hologram-Sharing functionality. I downloaded Holo-Academy Tutorial 250 and adapted it to my needs by replacing the island hologram with my own. So far so good, my Hologram and it's position is correctly shared between two HoloLenses. If a user clicks on a part of that hologram, a boolean is set and an animation is triggered.

My question is: what do I need to do to share the 'was-clicked' information (means: person B should see the same animation as person A, who triggered it by clicking on the hologram)? The chapter "Digging into the code" (https://developer.microsoft.com/en-us/windows/mixed-reality/mixed_reality_250#digging_into_the_code) is not realy helpful, unfortunately.

Thanks for your help in advance!

Best Answer

Answers

  • dbarrettdbarrett ✭✭✭
    edited February 2018

    First of all I highly recommend you take a look at some basic Multiplayer tutorials for Unity just because developing multiplayer is a totally different way of thinking than a single player app. Second, I would take specifically a look at Commands and ClientRpc's.

    The easy way most people will show you is to use the Command as a wrapper method and then the ClientRpc will go out to all other clients. Where the player would call the Command. This way is good when you don't have to make a lot of calls to the server.

    Something like this:

    [Command]
    CmdDo()
    {
        RpcDo();
    }
    [ClientRpc]
    RpcDo()
    {
        //do something here
    }
    

    AR Developer

  • Hi @dbarrett , thanks for you help! It seems that I can't use [Command] and [ClientRcp] in my C# Script since it already inherits from MonoBehaviour. According to errors shown in Unity console it needs to inherit from NetworkBehaviour. So I created a new class, let it inherit from NetworkBehaviour, added a function and tried to use it from my MonoBehaviout Script but unfortunately this is not working as well... can you recommend a tutorial for this topic?

    What I need is that my function
    public void OnInputClicked(InputClickedEventData eventData)
    from my C# script, which is attached to a gameobject, will be executed on each HoloLens in case a user taps on it.

  • Wile_EWile_E
    edited March 2018

    @dbarrett Thank you very much for the link and the hint! :) I don't know why I haven't seen it that I just needed to replace MonoBehaviour by NetworkBehaviour - maybe I need more coffee :#
    I can build the project now, anyway the click / tap gesture is not submitted to the second hololens.. I don't know why but I hope I will find out the reason for this.

    Update: After reading the docs for a while now it turns out that I might have some special case: the tutorial is dealing with playerObjects but in my case I have a 'neutral' object in the scene, that should be clickable by every player. I still don't understand why a click on the object is not transmitted to other players / clients.. I hope I will find the solution soon since I need to finish this within the next days :neutral:

Sign In or Register to comment.