# How do i play music when my player transforms

**URL:** <https://forums.unrealengine.com/t/how-do-i-play-music-when-my-player-transforms/474388>\
**Category:** Audio\
**Tags:** background, unreal-engine, music, question\
**Created:** [November 12, 2020, 10:41pm UTC](https://forums.unrealengine.com/t/how-do-i-play-music-when-my-player-transforms/474388 "2020-11-12T22:41:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrPRODude](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrPRODude](https://forums.unrealengine.com/u/MrPRODude)\
**Post date:** [November 12, 2020, 10:41pm UTC](https://forums.unrealengine.com/t/how-do-i-play-music-when-my-player-transforms/474388/1 "2020-11-12T22:41:51Z")

</div>

Hello guys this things been bugging me for some time on my project. what i’m trying to make when the player transforms lets say to super sonic a certain background music playes and after the transformation is = to false i want to remove that background music. no matter what i try it just doesn’t work eather i get some sort of runtime error while doing toggling and setting active. any advice ?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_50949673](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_50949673](https://forums.unrealengine.com/u/anonymous_user_50949673)\
**Post date:** [November 13, 2020, 9:53pm UTC](https://forums.unrealengine.com/t/how-do-i-play-music-when-my-player-transforms/474388/2 "2020-11-13T21:53:10Z")

</div>

I think it would be better if you would show us your blueprint so we can see how you deleting the music 🙂

---

<div class="post-metadata">

**Author:** ![MrPRODude](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrPRODude](https://forums.unrealengine.com/u/MrPRODude)\
**Post date:** [November 14, 2020, 1:47pm UTC](https://forums.unrealengine.com/t/how-do-i-play-music-when-my-player-transforms/474388/3 "2020-11-14T13:47:09Z")

</div>

> **[Gyazo](https://gyazo.com/6f0aadfe5e53df016846778889c3df77)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

> **[Gyazo](https://gyazo.com/2ee1208cab489a5e4363948daba4e929)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

i added the event on an event tick  
any idea why it doesn’t work when i play inside it works fine but when i get off the editor it gives me this error

---

<div class="post-metadata">

**Author:** ![Alekann01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alekann01](https://forums.unrealengine.com/u/Alekann01)\
**Post date:** [November 14, 2020, 2:54pm UTC](https://forums.unrealengine.com/t/how-do-i-play-music-when-my-player-transforms/474388/4 "2020-11-14T14:54:44Z")

</div>

Hi MrPRODude

Firstly, try to avoid using Tick to call singular events. It is extremely dangerous/bad practice.

I would only use “Sound2D” for UI audio or in widgets. For world objects, it is better to attach an audio component.

If you just want to change the background music depending on the mode, then you can simply swap the asset file.

In this example, I added an audio component to the pawn and ensure it was set to “Auto Activate”

 ![322028-changeaudio.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/3/103ec3707d9e6f81b75206570b9f2db0a20155db.png)

Good luck

Alex
