• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker How to move phy_position without breaking the simulation of physics? GM2[HALF-SOLVED]

Carloskhard

Member
I'm making an space game where there are planets(circular planets) with platforms attached to them that spin with them by changing his phy_position and phy_rotation manually(GIF BELOW).



Works perfect BUT physics simulation gets broken: collisions work but friction between the ship and the platform which has landed on the platform don't, which makes the ship slides out of the platform as it rotates with the planet.

In other words: HOW can I move phy_position manually without breaking the simulation(So I can get friction working)?

EDIT: I've used a joint to attach the platform to the planet and works perfectly.
The code is simple for anyone interested:
GML:
"if(instance_exists(OBJTOATTACHTO)) physics_joint_revolute_create(id, OBJTOTATTACHTO, x, y, 0,0,false,false)".
However this solution works for this specific case, but I'm still curious on how to solve this for other cases. If anyone wants to help, ideas are welcome.
 
Last edited:
Top