Sign in to follow this  
T

How to Tween Scale with Physics (Push Other Sprites)

Recommended Posts

I have an immovable sprite. I'm scaling this sprite up with tween but I don't know how to make it push other sprites (with physics) on it's way. Any help would be appreciated.

Share this post


Link to post
Share on other sites

Apparently, only when the wall has a velocity attached to its body -

innerWall.body.velocity
it can collide with the start and push them, but it only works at the direction of the velocity.
meaning, if it has a positive velocity.x, it will push stars to the right, but will not push stars to the left.
you can write:
innerWall.body.velocity.x = 0.0001;
innerWall.body.velocity.y = 0.0001;

so the movement will not be seen, but again, this will only solve the problem in 2 directions out of 4 (right & down).

Share this post


Link to post
Share on other sites

It makes sense (kinda) but still doesn't seem to work like you say. Did you maybe change something else too?

Also the original question remains unanswered as what you proposed is more like a workaround.

Share this post


Link to post
Share on other sites

See the gif to better understand what I'm trying to achieve (the sprite doesn't have to be a square). The square should push the stars instead of going above them.

4gshA.gif

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.

Guest
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.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.