I’m trying to create some background music in my game.
I’ve change the sample.inl to enable sounds and such, but whenever i attempt to call SetLooped i get a read access violation as the Sound is null. The music is there in the Data folder.
Sound* music = cache->GetResource<Sound>("Music/background.ogg");
music->SetLooped(true);
backgroundMusic = scene_->CreateComponent<SoundSource>();
backgroundMusic->SetSoundType(SOUND_MUSIC);
backgroundMusic->Play(music);