Distance model for music

0 favourites
  • 4 posts
From the Asset Store
Create your game with this complete pack of images and animations!
  • Hey guys, i need your help. :)

    I dont know how to add distance model for music. The watersounds should get louder if player is on the bridge. If he moves away the volume should get lower. See in the video below:

    [TUBE]n9wUIFgG7Bo[/TUBE]

    So i asked in an other thread, but didnt get a reply. Thats why i opened a new thread. Didnt want to spam. ;)

    I figured out that it can work like this: System every tick -> Set volume(-distance(player.X, Player.Y, Sound.X, Sound.Y)/10 dB)

    But i dont know how to embed it in my eventsheet. For example what is PlayerX and Y..SoundX and Y? What are the instructions after "System every tick". If i click "set volume" i only can type in a tag and volume..

    Many questions.. ;) Sry for bad english..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can set up positional audio properties in the Audio object itself, then just assign a listener object in the event sheet. Here's a demo; drag-and-drop the green sprite.

  • what GeometriX said... also pretty awesome looking graphics

    i like the clean vector style :D

  • Thank you for your quick reply! :)

    But i didnt get it.. I updated construct, and saw the audio properties for the first time. :P

    Since the update my Footstepsounds didnt work anymore.

    (Keyboard/Right arrow is down - Audio/Play "run")

    (Keyboard/On Right arrow realeased - Audio/Set "run" muted)..i think because of the new audio properties. Dont know how to solve it..

    For the distance model i tried this:

    (System/On start of layout - Audio/Set listener objekt to "player")

                                            - Audio/Play "water" not looping at volume db 0 at objekt "bridge"(...))

    The sound is playing, but always at the same volume..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)