Ashley Posted April 10, 2017 Share Posted April 10, 2017 I'm working on a Pachinko-like game and have a question about physics. I'm new to Phaser, so if this is an obvious answer, sorry! I have a star-shaped pin wheel thing. I need it to be stationary but rotate around its anchor point when hit by an object (based on physics). How would I go about making it stationary, but allowing it to be rotated based on objects colliding with it? (I know how to get the polygon collision using the Physics Editor, I'm just not sure about the rotation part). Any help will be greatly appreciated! Thanks. Link to comment Share on other sites More sharing options...
Tom Atom Posted April 11, 2017 Share Posted April 11, 2017 Hi, what you are looking for is probably "Revolute Constraint". Look at this example: http://phaser.io/examples/v2/p2-physics/revolute-constraint Also take a look at examples (Car / Segway / Constraints) here: https://github.com/schteppe/p2.js Link to comment Share on other sites More sharing options...
Ashley Posted April 11, 2017 Author Share Posted April 11, 2017 Thanks for the response, Tom. The first example worked perfectly! I placed a "pin" in the center of the star as the second body and cleared the collision of the "pin". Thanks, again! Link to comment Share on other sites More sharing options...
Recommended Posts