# VR ue4 Setting the material with an interactive laser pointer

**URL:** <https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320>\
**Category:** Architectural and Design Visualization\
**Tags:** unreal-engine, question\
**Created:** [December 26, 2022, 1:32pm UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320 "2022-12-26T13:32:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![G.Piren](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@G.Piren](https://forums.unrealengine.com/u/G.Piren)\
**Post date:** [December 26, 2022, 1:32pm UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/1 "2022-12-26T13:32:47Z")

</div>

Hello!  
How can you solve the problem of assigning a specific material using a laser pointer?  
I wanted to use the pickup event but can’t get it to work with multiple static meshes. Works only on any one grid. I tried splitting the event with “Toggle by Name” tags but don’t know how to make it work, I’m still new to this. I would appreciate any help!

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/7/f37c542efa735cb76de22b7d9091ba648f8448ee.jpeg "0") ](https://www.youtube.com/watch?v=ZZQLdpD9DjM)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/1/ef19aece904d50172d85e66577dc0a229bae0402.jpeg "1") ](https://www.youtube.com/watch?v=JsYevSYnDFc)

 ![c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/9/a79572b17ff6f78074747a670996629f9dadae51.jpeg)

 ![c2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/9/c99488cbb782fc5d2d59f253101b63d65aa551fa.jpeg)

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [December 26, 2022, 11:19pm UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/2 "2022-12-26T23:19:36Z")

</div>

Hi G.Piren,

I put together a sample project for you.

Fun Features:

The Color Picker BP can control any static mesh. (Color picker is not linked to any specific mesh)

The only place you need to change the color is the sphere. (It automatically grabs current color from sphere and applies it to target mesh)

There are many ways to implement this, but I used the ‘Component Tags’ , a different tag for each sphere. And once the sphere is interacted with, it sends that tag info to BP\_ColorPicker.

Hope that helps, let us know how it goes. (Project was created with 5.0, but can be opened in 5.1+)

[AJ\_ColorPicker.zip](https://forums.unrealengine.com/uploads/short-url/t2aUJZtz5gRtFJcxyL3DMFTcWtK.zip) (872.8 KB)

---

<div class="post-metadata">

**Author:** ![G.Piren](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@G.Piren](https://forums.unrealengine.com/u/G.Piren)\
**Post date:** [December 27, 2022, 10:35am UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/3 "2022-12-27T10:35:12Z")

</div>

Hi Astrotronic! Thank you very much for your solution, I will check it today

---

<div class="post-metadata">

**Author:** ![G.Piren](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@G.Piren](https://forums.unrealengine.com/u/G.Piren)\
**Post date:** [December 27, 2022, 2:07pm UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/4 "2022-12-27T14:07:21Z")

</div>

Hi Astrotronic!  
It seems to work well 😀  
There is another problem, my object (chair) consists of several meshes, how do I make it an array so that the material is applied to all selected meshes like this chair?

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/a/9caa6fecca92fd4140e0a7bef206e90c80f82e45.jpeg "rr") ](https://www.youtube.com/watch?v=ZMZve3ugGDU)

 ![r1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/b/12b8b5e4ba2a6d324298973deff5766d9b16692d.jpeg)  
 ![r2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/f/a/3fa4898fbd287bc631783c9fced36e58ed71450d.jpeg)  
 ![r3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/c/5fc7e2722662d3e8fdaaa8ee668a70dace100fb0.jpeg)

---

<div class="post-metadata">

**Author:** ![G.Piren](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@G.Piren](https://forums.unrealengine.com/u/G.Piren)\
**Post date:** [December 27, 2022, 4:14pm UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/5 "2022-12-27T16:14:50Z")

</div>

I think this can be quite a cumbersome solution if there are many objects with different materials.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/0/970222a440b6bc83c68be80db77d8fb74c8467fd.jpeg "rr2") ](https://www.youtube.com/watch?v=hJt3jmXBa6I)

 ![several objects](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/4/bc44ee656991fd0082577f69496395d385e0c335.jpeg)

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [December 28, 2022, 2:51am UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/6 "2022-12-28T02:51:34Z")

</div>

Glad to hear that it works well!

For more meshes, It would probably be easier just to create a few extra mesh references.

 ![secondmesh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/b/afb6c4445d602294c1beb5db63ca97c9c188bfda.png)

Although ultimately I think you’ll find that most meshes use material channels. (Single mesh with 1 channel for wood and 1 for cloth)

In your BP\_MotionController, you don’t need to cast to each sphere, Just the BP\_ColorPicker. (And then it looks at the component you just hit, and passes that to the specific instance of BP\_ColorPicker you just hit.)

---

<div class="post-metadata">

**Author:** ![G.Piren](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@G.Piren](https://forums.unrealengine.com/u/G.Piren)\
**Post date:** [December 28, 2022, 9:42am UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/7 "2022-12-28T09:42:13Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Santi\_720](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Santi\_720](https://forums.unrealengine.com/u/Santi_720)\
**Post date:** [March 18, 2024, 8:07am UTC](https://forums.unrealengine.com/t/vr-ue4-setting-the-material-with-an-interactive-laser-pointer/736320/8 "2024-03-18T08:07:54Z")

</div>

I’m attempting to modify the texture and color of objects by clicking on a sphere. Initially, I successfully implemented this functionality using the FirstPerson template. However, I’m now encountering issues when attempting to do the same with the VR template. I’m unable to interact with the sphere or trigger the click action. Can someone provide assistance or suggest a solution for this? I’ve attached the blueprints I’ve been working with for reference.

 ![BP_MaterialSphere](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/e/a0ea467d1228e3a0484603739f5600c17f763bd2.png)  
 ![EventGraph - BP_MaterialSphere](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/285339d3af6bfaebe711edff662f5d42710b33eb.png)  
 ![MatSphereStruct](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/1/d419510a7fe2418982e08a7a93b905da8a7acdd2.png)  
 ![VRPawn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/c/7bc1c4e8f124f7412ea589ec07e8088ae238358d.png)  
 ![VRTemplateMap](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/1/af150105310b7e23efa4eb451d1012b1117de2b2.jpeg)
