Jessicaward25 Posted August 4, 2015 Share Posted August 4, 2015 I have a player sprite, and a platform sprite.. I want the player to be affected by gravity, but not the platform. Here's the code that I have now..game.physics.arcade.gravity.y = 500;But is there a way to set it so it's just player affected by it? Something like this?player.gravity = 500; Link to comment Share on other sites More sharing options...
AzraelTycka Posted August 4, 2015 Share Posted August 4, 2015 Hello, turn off your gravity.y (set it to 0 or don't set it at all) and go with yourSprite.body.gravity.y = yourValue; (in your case: player.body.gravity.y = yourValue;) - don't forget to enable arcade physics on your sprite (player). Link to comment Share on other sites More sharing options...
rich Posted August 4, 2015 Share Posted August 4, 2015 Please stop creating the same question over and over. Just read the answers you're given in the other threads (such as this one http://www.html5gamedevs.com/topic/16209-changing-sprite-position/#entry91638) Link to comment Share on other sites More sharing options...
Recommended Posts