lateUpdate in Phaser?

Recommended Posts

Hey there!

I'm trying to make a Speak Bubble follow the player so I use this code

if (typeof(speakBubble.speaker) !== "undefined")
    speakBubble.position.x = speakBubble.speaker.position.x + speakBubble.speakerOffsetX;
    speakBubble.position.y = speakBubble.speaker.position.y + speakBubble.speakerOffsetY -

in the update function of the game state. The player or "speaker" has arcade physics applied to it and moves in a platformer manner. The problem is that the speak bubble updates BEFORE the physics system updates the player so it shifts slightly to the right when the player moves left and left when they move right, etc. Is there a function that I can use to update the speak bubble AFTER physics update (perhaps like the LateUpdate() function in Unity)?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.