Sign in to follow this  

sync audio to start of tween

Recommended Posts



I'm trying to sync audio to the start of a tween.


this.myTween = this.add.tween(...)

this.myTween.onStart.add(this.playSound, this)


Instead, the audio plays first and then a few moments later the tween starts.


I read the onStart should wait until the tween starts, but this doesn't seem to be happening.


Please help!


Share this post

Link to post
Share on other sites

Hi, the tween moves the sprite.  The sound needs to play at the start of this movement.  I'm not sure how to set the delay to zero.


tween1: function() {

  this.tweenMini1 = this.add.tween(this.spriteMini).to({ y:}, 2000, Phaser.Easing.Back.In, true, 0);
  this.tweenMini1.onStart.add(this.playSwoosh, this);



playSwoosh: function() {;
  this.swoosh.volume = 0.3;

Share this post

Link to post
Share on other sites

your delay is 0 already


I believe it's your easing.. look here:


see how it goes down and then up... (i've marked it in green).. I think you're not seeing it until the up part of the graph there. if it's an opacity alpha then of course you're not going to see any negative alpha... so yes it's going to look delayed

[edit: sorry you're tweening Y.. i'm not sure about that then.. it depends where your sprite is starting. you should see it moving if it's on screen)


I'm don't know what easings Phaser includes but use this to compare with what you need



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.