Adding more than one component file at once

#1

I have painstakingly created over 100 sound files to be used in my game. Is there a way to add all of these to a game object, rather than one at a time?!

3 Likes

#2

The source files are text format, so it’s possible to add them in a text editor of your choice.

1 Like

#3

Yeah, that was my first thought, actually! When I opened the files they were a bit “messy”, with redundant properties like “position” and “rotation” (which doesn’t apply to sound files in the editor):

  "components {\n"
  "  id: \"G4\"\n"
  "  component: \"/game/sounds/G4.sound\"\n"
  "  position {\n"
  "    x: 0.0\n"
  "    y: 0.0\n"
  "    z: 0.0\n"
  "  }\n"
  "  rotation {\n"
  "    x: 0.0\n"
  "    y: 0.0\n"
  "    z: 0.0\n"
  "    w: 1.0\n"
  "  }\n"
  "}\n"

In the end a bit the bullet and added them all manually, to be sure I didn’t mess up the file structure.

0 Likes

#4

I’m at it again with sounds, and have promoted this post to an Official Feature Request! :slight_smile:

It would save so much time to be able to add more than one file at a time.

Edit: I’m demoting it again, because I realised you can add sound components directly to a collection, without having to first create a .sound file. Leaving this here mostly as a note to self for when I come to add sounds to the next game.

0 Likes

#5

I’ve found it easiest to copy one of the sounds already present and then rename it/change the sound.

1 Like

#6

Yes, that’s what I now started doing. This is time consuming when it’s a file, but when it’s an object inside a collection it’s pretty plain sailing.

0 Likes

#7

I wonder if this couldn’t be solved by an editor extension? Select multiple wav or ogg files and right click->Add as sound components to add them to the currently open collection or game object

4 Likes