enriqueto Posted March 4, 2014 Share Posted March 4, 2014 How can I declare a sprite body static? By setting its gravity to zero? And how would you implement not visible sensors? Link to comment Share on other sites More sharing options...
Heppell08 Posted March 4, 2014 Share Posted March 4, 2014 sprite.body.allowGravity = false;Depends what you mean but i'm guessing the above code is what you might need. Link to comment Share on other sites More sharing options...
enriqueto Posted March 4, 2014 Author Share Posted March 4, 2014 thanks it works. I'm using an extended group for the user interface. How would you prevent the buttons of that group to fall? Link to comment Share on other sites More sharing options...
rich Posted March 4, 2014 Share Posted March 4, 2014 Set button.body = null, then they won't react to any physics at all. Link to comment Share on other sites More sharing options...
enriqueto Posted March 5, 2014 Author Share Posted March 5, 2014 thanks Rich! my game is a platformer with scroll on both directions with the camera following the player. What should I do for that button (the group that it contains it) to remain at the same position of the screen? Link to comment Share on other sites More sharing options...
Heppell08 Posted March 5, 2014 Share Posted March 5, 2014 nameofgroup.fixedToCamera = true;If the group is a UI based group or if its just a certain button then:nameofbutton.fixedToCamera = true; Link to comment Share on other sites More sharing options...
Recommended Posts