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.
Options

How can I scale an object

Hi everybody,

I am trying to scale an object like in the Hololens but don't know how to do it. Is there an simple code in the HoloKit?

Answers

  • Options

    @Memo
    You can scale object with Vector 3 transform.localscale with multiplication

    Vector3 scale = transform.localScale;
    scale *= 2;
    transform.localScale = scale;

    Thanks,
    Ankit Sangani

  • Options

    @Ankit09_Sangani Thanks for your help. I Create 8 Points arround the object and want to change the size of my object. I am an beginner and don't know where should i write your code. Can you write the code in more detail? Any recommendation?

  • Options

    Your code should be on MonoBehaviors attached to your gameObjects. I'd check out the tutorials here to get a better understanding of how everything fits together: https://unity3d.com/learn

    Taqtile

  • Options

    @mark_grossnickle thanks for the link and also for the hint

  • Options

    Don´t have any progress. Where can I find some example codes? @mark_grossnickle @Ankit09_Sangani ?

  • Options

    @Memo

    In Holotoolkit there is OnSelectEvent() Event you can Add that Event in addComponent of inspector Elemet.

    create new script and add below method
    public void ScaleBigger(){
    Vector3 scale = transform.localScale;
    scale *= 2;
    transform.localScale = scale;
    }

    Thanks
    Ankit Sangani.
    Skapy ankit.sangani4

  • Options

    @Ankit09_Sangani said:
    @Memo

    In Holotoolkit there is OnSelectEvent() Event you can Add that Event in addComponent of inspector Elemet.

    create new script and add below method
    public void ScaleBigger(){
    Vector3 scale = transform.localScale;
    scale *= 2;
    transform.localScale = scale;
    }

    Thanks
    Ankit Sangani.
    Skapy ankit.sangani4

    But isn't this an OnSelect event? I think OP wanted to know how to use the 'on hold' gesture to drag points of a bounding box to scale it.

Sign In or Register to comment.