# change objects

**URL:** <https://forums.unrealengine.com/t/change-objects/39842>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [August 26, 2015, 8:18pm UTC](https://forums.unrealengine.com/t/change-objects/39842 "2015-08-26T20:18:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_7dfcb09a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7dfcb09a](https://forums.unrealengine.com/u/anonymous_user_7dfcb09a)\
**Post date:** [August 26, 2015, 8:18pm UTC](https://forums.unrealengine.com/t/change-objects/39842/1 "2015-08-26T20:18:17Z")

</div>

Hello.  
I would like to achieve this:  
Let`s say I have 3 different actor blueprints containing an individual object (for example 1=chair in red, 2=chair in green, 3=chair in blue).  
Now I have 3 buttons in a hud, clickable by the mouse. By clicking button 1 the red chair appears in my level, by clicking button 2 the green chair  
appears AND the red chair disappear and so on. So I always see only one chair, choosen by the buttons.  
Is there an pretty easy way to do this ?  
By the way, I know there is a way to change colors with a dynamic material instance, but this is not the goal. I want to switch through the objects.  
A hard cut (visible on/off) is enough.  
Thanks a lot and bye

---

<div class="post-metadata">

**Author:** ![\_cDub](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_cDub](https://forums.unrealengine.com/u/_cDub)\
**Post date:** [August 26, 2015, 9:21pm UTC](https://forums.unrealengine.com/t/change-objects/39842/2 "2015-08-26T21:21:41Z")

</div>

You could just have one actor blueprint with one static mesh component. On the button click call an event on the blueprint and pass the static mesh you want through a static mesh input on the custom event. On the custom event on the actor, set the static mesh component to what you sent through the input.

---

<div class="post-metadata">

**Author:** ![EniGmaa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EniGmaa](https://forums.unrealengine.com/u/EniGmaa)\
**Post date:** [August 26, 2015, 10:00pm UTC](https://forums.unrealengine.com/t/change-objects/39842/3 "2015-08-26T22:00:51Z")

</div>

> [@Flowmaster;365260](#):
>
> Hello.  
> I would like to achieve this:  
> Let`s say I have 3 different actor blueprints containing an individual object (for example 1=chair in red, 2=chair in green, 3=chair in blue).  
> Now I have 3 buttons in a hud, clickable by the mouse. By clicking button 1 the red chair appears in my level, by clicking button 2 the green chair  
> appears AND the red chair disappear and so on. So I always see only one chair, choosen by the buttons.  
> Is there an pretty easy way to do this ?  
> By the way, I know there is a way to change colors with a dynamic material instance, but this is not the goal. I want to switch through the objects.  
> A hard cut (visible on/off) is enough.  
> Thanks a lot and bye

there are several ways you can do this. You can either make a blueprint for each of them . then create a sort of spawn in system that would use a widget button to spawn them in. This method is more complicated to set up though.

Another easier way you could do this is just already have them in the level. Add them to an array or create references to each of the mesh then you simply use a button or several buttons to toggle the visibility.

eg click the button once, this sets red chair to visible and sets green and blue chair to invisible  
click the button again, this sets blue chair to visible and sets green and red chair to invisible etc etc

---

<div class="post-metadata">

**Author:** ![EniGmaa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EniGmaa](https://forums.unrealengine.com/u/EniGmaa)\
**Post date:** [August 26, 2015, 10:28pm UTC](https://forums.unrealengine.com/t/change-objects/39842/4 "2015-08-26T22:28:23Z")

</div>

here you go just a quick demo project i threw together .

press the B key on the keyboard for blue cube  
press the R key on the keyboard for the red cube  
press the G key on the keyboard for the green cube

i used keyboard keys just to show you . you should be able to work out from my example how to use buttons to do the same thing instead.

hope this helps

---

<div class="post-metadata">

**Author:** ![EniGmaa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EniGmaa](https://forums.unrealengine.com/u/EniGmaa)\
**Post date:** [August 26, 2015, 10:55pm UTC](https://forums.unrealengine.com/t/change-objects/39842/5 "2015-08-26T22:55:09Z")

</div>

sorry forgot to post the link lol ^\_\_\_^

[https://www.dropbox.com/s/9berh01zxu9718q/test\_colour\_Cubes.zip?dl=0](https://www.dropbox.com/s/9berh01zxu9718q/test_colour_Cubes.zip?dl=0)

or blueprint screen shot if you prefer to do it yourself

 ![t9s7R3o.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/1/2f11a11bd5eef50314dc3a2340e351861c7e28a6.png) ![TotWL5B.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/2/fc287ee9bb2233e4bbfd98ac260a10aa8fc0f7f9.png) ![EDDcNCv.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/6/06e1198d29e21570eccb8110648a24b955321c4c.png)

---

<div class="post-metadata">

**Author:** ![JmDevTx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JmDevTx](https://forums.unrealengine.com/u/JmDevTx)\
**Post date:** [August 26, 2015, 11:14pm UTC](https://forums.unrealengine.com/t/change-objects/39842/6 "2015-08-26T23:14:46Z")

</div>

> [@EniGmaa;365364](#):
>
> sorry forgot to post the link lol ^\_\_\_^
> 
> [https://www.dropbox.com/s/9berh01zxu9718q/test\_colour\_Cubes.zip?dl=0](https://www.dropbox.com/s/9berh01zxu9718q/test_colour_Cubes.zip?dl=0)
> 
> or blueprint screen shot if you prefer to do it yourself

While this may work fine in his situation (cubes), you won’t want to do this if your meshes are in different locations, or are different shapes. Setting an actor to be hidden will not disable it’s collision, but merely hide the actor. You could disable collision after setting it to be hidden, but personally I would spawn/destroy the actors.

---

<div class="post-metadata">

**Author:** ![EniGmaa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EniGmaa](https://forums.unrealengine.com/u/EniGmaa)\
**Post date:** [August 27, 2015, 5:46am UTC](https://forums.unrealengine.com/t/change-objects/39842/7 "2015-08-27T05:46:32Z")

</div>

> [@Jamendxman3;365378](#):
>
> While this may work fine in his situation (cubes), you won’t want to do this if your meshes are in different locations, or are different shapes. Setting an actor to be hidden will not disable it’s collision, but merely hide  
> the actor. You could disable collision after setting it to be hidden, but personally I would spawn/destroy the actors.

Yeah true mate but he didn’t ask about collisions all he wanted was to show or hide the chairs (cubes) on button press so I gave him the simplest and easiest example way to do this.

But It all depends what he wants to use it for really. Also to change the code to spawn the actors instead wouldn’t be that difficult .

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7dfcb09a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7dfcb09a](https://forums.unrealengine.com/u/anonymous_user_7dfcb09a)\
**Post date:** [August 27, 2015, 7:49am UTC](https://forums.unrealengine.com/t/change-objects/39842/8 "2015-08-27T07:49:39Z")

</div>

Hey this is cool 😃 Many thanks to you.  
I will try this and give you feedback.  
Thanks again.

---

<div class="post-metadata">

**Author:** ![TonyJim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TonyJim](https://forums.unrealengine.com/u/TonyJim)\
**Post date:** [September 25, 2025, 8:57pm UTC](https://forums.unrealengine.com/t/change-objects/39842/9 "2025-09-25T20:57:38Z")

</div>

You can do this with **Destroy/Spawn on a Switch on Int**.  
The idea: keep a reference to the _currently spawned actor_. When a button is clicked, you destroy the previous one (if any), then **Switch on Int** to choose which class to spawn, and store the new reference.

**Blueprint outline (matches the screenshot approach):**

1. **Variables:**  
• `CurrentActor` (Actor reference)  
• `CurrentID` (Integer)  
• `SpawnPoint` (SceneComponent) – place it where you want the chair to appear  
• Optionally: `Class_Red`, `Class_Green`, `Class_Blue` (TSubclassOf Actor)

2. **Event: `Load(ID)`** (called by your UI buttons with 1/2/3):  
• `IsValid(CurrentActor)` → **Branch** → if **True** → **DestroyActor(CurrentActor)**  
• **Switch on Int** (`ID`)  
– **1** → **SpawnActor** (Class = `Class_Red`, Transform = `SpawnPoint.GetWorldTransform`) → set **CurrentActor** to Return Value → set **CurrentID = ID**  
– **2** → **SpawnActor** (Class = `Class_Green`, Transform = `SpawnPoint.GetWorldTransform`) → set **CurrentActor** → set **CurrentID**  
– **3** → **SpawnActor** (Class = `Class_Blue`, Transform = `SpawnPoint.GetWorldTransform`) → set **CurrentActor** → set **CurrentID**  
• (Optional) Set **Collision Handling Override = “Always spawn, ignore collisions”** on SpawnActor if the spot can be occupied.

3. **UI wiring:**  
• Button 1 → calls `Load(1)`  
• Button 2 → calls `Load(2)`  
• Button 3 → calls `Load(3)`

This guarantees you only ever see one chair: click → destroy the old one → spawn the selected one at the same transform.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/b/8db84e5b8c6ed8118681d9c01b7804910aa1eb8c.png)
