# How to change the opacity of the model using the slider

**URL:** <https://forum.magicleap.cloud/t/how-to-change-the-opacity-of-the-model-using-the-slider/4751>\
**Category:** Unity Development\
**Tags:** development\
**Created:** [December 11, 2024, 5:30am UTC](https://forum.magicleap.cloud/t/how-to-change-the-opacity-of-the-model-using-the-slider/4751 "2024-12-11T05:30:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![acharya](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@acharya](https://forum.magicleap.cloud/u/acharya)\
**Post date:** [December 11, 2024, 5:30am UTC](https://forum.magicleap.cloud/t/how-to-change-the-opacity-of-the-model-using-the-slider/4751/1 "2024-12-11T05:30:43Z")

</div>

Hi Folks,

I have imported the Vuforia Eyewear sample project into Unity and built the Model Target application for Magic Leap 2. How can I change the opacity of the model using a slider? Any script for adjusting the model's opacity/transparency with a slider would be greatly appreciated.

BR  
Sandy

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [December 11, 2024, 6:05pm UTC](https://forum.magicleap.cloud/t/how-to-change-the-opacity-of-the-model-using-the-slider/4751/2 "2024-12-11T18:05:03Z")

</div>

You can use the [Slider.onValueChanged SliderEvent](https://docs.unity3d.com/2018.2/Documentation/ScriptReference/UI.Slider-onValueChanged.html) to update the [material's transparency value](https://docs.unity3d.com/6000.0/Documentation/Manual/StandardShaderTransparency.html).

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [December 19, 2024, 8:55pm UTC](https://forum.magicleap.cloud/t/how-to-change-the-opacity-of-the-model-using-the-slider/4751/4 "2024-12-19T20:55:36Z")

</div>

Unfortunately since this is not specific to Magic Leap, the question on how to use the Mixed Reality Slider or UI slider is outside of the scope of this forum. I recommend reaching out on the MRTK GitHub or the Unity discussion page [https://discussions.unity.com/](https://discussions.unity.com/).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/bd9b737a4d45ea243aa7eb177d60a773b806899a.svg) [@system](https://forum.magicleap.cloud/u/system)\
**Post date:** [January 2, 2025, 8:56pm UTC](https://forum.magicleap.cloud/t/how-to-change-the-opacity-of-the-model-using-the-slider/4751/5 "2025-01-02T20:56:27Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
