gg.wilson Posted November 28, 2017 Share Posted November 28, 2017 Hey everyone hopefully this is worded ok and you are having a good day. I currently have a playable character which can be moved around and collide with objects. The issue i am having is once it has collided with a certain object i want the players character sprite to increase in size however when i do this using sprite.scale.setTo for some reason the position of the player sprite moves to 0,0. Apologise if that was not enough information i can provide more if needed. Link to comment Share on other sites More sharing options...
DanielKlava Posted November 29, 2017 Share Posted November 29, 2017 Hello! You can try setting the scale as below: sprite.scale.x = 1.5; // Increases the X scale by 1.5x times. sprite.scale.y = 2; // Increases the X scale by 2x times. A similar use of this example is to "invert/mirror" the sprite, you just have to set the scale to -1. Link to comment Share on other sites More sharing options...
samme Posted November 29, 2017 Share Posted November 29, 2017 19 hours ago, gg.wilson said: The issue i am having is once it has collided with a certain object i want the players character sprite to increase in size however when i do this using sprite.scale.setTo for some reason the position of the player sprite moves to 0,0. If a sprite changes size (instantly), it can cause new collisions that move the sprite. But the scale change itself doesn't affect position. Link to comment Share on other sites More sharing options...
Recommended Posts