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.
-
37:44
Glenn Greenwald
14 hours agoGlenn On Tearing Down the Military Industrial Complex, Exposing Pro-Israel Indoctrination, and More | SYSTEM UPDATE #411
110K121 -
4:04:20
Nerdrotic
13 hours ago $51.23 earnedAmazon Takes 007! Hollywood is Lost, Disney Cancels WHO? | Friday Night Tights 342 /w ItsAGundam
171K42 -
43:27
Tucker Carlson
13 hours agoRay Dalio: America’s Hidden Civil War, and the Race to Beat China in Tech, Economics, and Academia
165K190 -
56:56
Candace Show Podcast
13 hours agoEXCLUSIVE: Taylor Swift Will Be Deposed. | Candace Ep 150
197K153 -
1:03:52
IsaacButterfield
10 hours ago $6.33 earnedRepublican Vs 25 Transgender Activists | Jewish Outrage | Lizzo Loses All the Weight
60.5K14 -
1:10:23
Edge of Wonder
14 hours agoChinese Biochips Hacking Minds? Quantum Control & Journey Song Mandela Effect
82.7K9 -
2:15:46
Quite Frankly
17 hours ago"Ghosts, Robotics, and OBE's" ft. Dr. Albert Taylor 2/21/25
75.9K18 -
55:52
LFA TV
1 day agoMaking Germany Great Again | TRUMPET DAILY 2.21.25 7PM
50.7K9 -
1:52:26
2 MIKES LIVE
12 hours ago2 MIKES LIVE #183 Open Mike Friday with Hannah Faulkner and Adelia Kirchner!
37.1K -
12:09
MrBigKid
13 hours ago $2.78 earnedNew Mossberg 590R: Tactical Homestead Defender
42.2K7