Premium Only Content

Rogue Engine - Playing Sounds - In Two Minutes
Rogue Engine enables you to attach a sound to an object in the scene.
So let's make an empty object and rename it.
We are going to create a new component to start the sound playing so, create a new Component asset and call it, Object Audio.
Now double click the component to open it in your code editor.
We need to reference the Three.js library at the top of the file as we want to add a property to the component that is a Three.Audio type.
The "true" parameter in the property indicates that this will be positional audio so that the sound will seem to come from the object in 3D space.
If we save our code and go back to the Rogue editor, we can drag and drop the component onto the Audio Background object. We will now see the objectAudio property we have defined is "unset".
So lets find some audio to go into this component. You can import an mp3 file into your asset panel and then drag and drop it into the objectAudio property.
Now we can go back to our code. We can make the audio play as soon as the scene is loaded by adding the following to the Start method.
First check that the objectAudio property has been set.
Then add the objectAudio to the object3D that this component is attached to.
We can set the audio to loop if we want to, then play the audio.
Save your code and go back to the Rogue editor. Now when we play our scene, the audio will play.
And that's how to attach audio to an object with Rogue Engine.
-
LIVE
megimu32
1 hour agoON THE SUBJECT: The Epstein List & Disney Channel Original Movies Nostalgia!!
188 watching -
9:06
Colion Noir
10 hours agoKid With Gun Shoots & Kills 2 Armed Robbers During Home Invasion
16.9K3 -
54:28
LFA TV
1 day agoUnjust Man | TRUMPET DAILY 2.27.25 7PM
19.7K2 -
DVR
CatfishedOnline
6 hours ago $1.19 earnedGoing Live With Allen Weekly Recap
21.8K -
20:10
CartierFamily
7 hours agoAndrew Schulz DESTROYS Charlamagne’s WOKE Meltdown on DOGE & Elon Musk!
36.8K45 -
1:36:39
Redacted News
5 hours agoBOMBSHELL EPSTEIN SH*T SHOW JUST DROPPED ON WASHINGTON, WHAT IS THIS? | Redacted w Clayton Morris
145K242 -
2:03:31
Revenge of the Cis
6 hours agoEpisode 1453: Fat & Fit
48.6K8 -
2:38:12
The White House
7 hours agoPresident Trump Holds a Press Conference with Prime Minister Keir Starmer of the United Kingdom
160K60 -
1:01:04
In The Litter Box w/ Jewels & Catturd
1 day agoDrain the Swamp! | In the Litter Box w/ Jewels & Catturd – Ep. 751 – 2/27/2025
91.7K35 -
1:11:24
Dr. Drew
8 hours agoNEW: Cardiac Arrest In Healthy Young People After mRNA w/ Nicolas Hulscher – Ask Dr. Drew
72.7K31