• 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 phy_fixed_rotation not persisting between rooms

B

BionicMatt

Guest
Hi all.

Getting to grips with GMS2 and the in-built physics, and have come across an issue. The same issue is mentioned in this thread, back in June:

https://forum.yoyogames.com/index.p...not-working-after-moving-between-rooms.64104/

In the creation code for my player object (which is persistent), I have set phy_fixed_rotation set to true. However, once transferred to another room, the player object begins to rotate when colliding with solid objects' corners (as if it were false).

HOWEVER, if I move the phy_fixed_rotation to the step event, all works as normal!

  • Both rooms and objects have physics enabled
  • Densities and physics properties are set normally for player and collision object
  • Changing either room's persistence does nothing

All other variables defined in the creation code are properly carried over when transitioning to the new room. Is this a known bug, or is something else potentially causing this?

Thanks,

Matt

By using a GUI debugging, I can say at least in this instance phy_fixed_rotation will be reset upon entering another room, even if persistent is enabled for the player object.

The best workaround I have is currently to create a 'Room start' event with phy_fixed_rotation = true. This is preferable to setting it at a room level, or a object step level.
 
Last edited by a moderator:

Yal

šŸ§ *penguin noises*
GMC Elder
My guess would be that the physics simulation is reset when changing rooms, and not all GM physics variables are fully linked to their Box2D counterparts. If all other variables including physics position carries over properly, this is probably a bug and should be reported (Help --> Report a Bug in the menu)
 
Top