Sound Emission

Hello, I would like to know how to do sound for an actor only when he is on the screen.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Put a play sound behavior in the actor, not in a rule or anything, and when the actor is on screen the sound will play.
  • MarkinhosMarkinhos Member Posts: 17
    I tried but it did not: (
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Did you turn on loop? Maybe it was just playing once.?
  • MarkinhosMarkinhos Member Posts: 17
    I put the tag "Play Sound"
    Desmarquei "loop"
    Desmarquei "run to completion"
    Desmarquei "Positional sound"
    Desmarquei "Velocity Shift"

    I also tried with the options checked.

    If I leave "Run to completion" marked. The sound is executed when the game starts.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Is the actor on screen when the game starts I guess? If so, isn't that what you are trying to do?

    I tested it last night and it worked as expected on my end. I can certainly give you the file if you need it but it should be very straight forward.
  • MarkinhosMarkinhos Member Posts: 17
    The actor with the sound is not in the home screen.
    The hero walks 2,000 pixels. When the hero arrives on the actor, and the actor appears on screen it should output the sound.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Really hard to say without seeing your exact code, sounds like there is an error in it for sure. I note you say 'the actor' twice, is that two different actors? If so which actor should be playing the sound?

    But based on what you just described I'd do this instead:

    Hero walks across screen and arrives on 'the actor' -

    Make a Rule, when the hero collides with the actor play your sound and display 'the other actor' (if there is one)

  • MarkinhosMarkinhos Member Posts: 17
    I control the Actor 1.
    As the "second actor" appears on the screen, the "second actor" should make a sound.
    How to do it?

    I do not have to use "bump" because the "second actor" is at the top of the screen. They do not collide.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Check out the attached, hope it helps.
  • MarkinhosMarkinhos Member Posts: 17
    @jamie_c
    Please download the file in the link:

    http://www.jogai.com/test-som.zip
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited August 2013
    I've looked at your project, here is what's going on:

    Your sound actor is placed in the game (off screen technically, but in the game) at the start, that is why the sound is firing immediately.

    If you want the sound to play only when the player character reaches the point of the "automatic sound now" spot you need to add a rule to the player to trigger the sound at that point. You could do this through a collision as I suggested above, of you could trigger it when you player reaches a certain X position.

    But you can't set it off just by placing your sound actor in the game because as you can see, it fires as soon as the current sound actor is active, which is immediately.

    Does the 'automatic sound now' actor serve any other purpose besides playing the sound? If not you won't need this actor at all. You would just play the sound from the behaviors in the player character.

    Hope that helps.
Sign In or Register to comment.