Befive.Info Posted October 17, 2018 Share Posted October 17, 2018 Hello, I am trying to imitate a rotating part (a.k.a. "windmill" please see this youtube video) using the Matter physics engine's constraint. I have tested a body shape made with PhysicsEditor and that of simple image shape (just a thin rectangle). The windmill made with PhysicsEditor keeps on rotating and it does not seem to stop until you give another collision to the body. Here is a codepen to demonstrate. https://codepen.io/BeFiveINFO/pen/EdQgdq Please try pressing space key for a second. Is there any way to control the behaviour of the body shape made with PhysicsEditor? Thank you for your help in advance! Link to comment Share on other sites More sharing options...
fmacpro Posted October 17, 2018 Share Posted October 17, 2018 Hey, you can use setFrictionAir(0.5); if you set it really low you should get what you want e.g. https://codepen.io/anon/pen/GYQdop?editors=0010 windMill.setFrictionAir(0.05); https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Matter.TileBody.html#setFrictionAir__anchor Befive.Info 1 Link to comment Share on other sites More sharing options...
AndreasLoew Posted October 17, 2018 Share Posted October 17, 2018 @fmacpro is right: That's because you have no air friction set. The windmill has no reason to stop. You can set friction in the physics settings - see screenshot. blackhawx and Befive.Info 2 Link to comment Share on other sites More sharing options...
Befive.Info Posted October 18, 2018 Author Share Posted October 18, 2018 @fmacpro Thank you! It worked like a charm! @AndreasLoew I was trying out your app Btw I just ordered the texture packer + physics editor bundle. Your apps do save time and is worth the money. Link to comment Share on other sites More sharing options...
Recommended Posts