Jump to content

How to Tween Scale with Physics (Push Other Sprites)


T
 Share

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.

Link to comment
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).

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...