Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Live room reload not working in physics enabled rooms

A topic by Oblivion Skull created 60 days ago Views: 133 Replies: 3
Viewing posts 1 to 3

When I go to reload a room that uses physics, the game crashes, due to the physics no longer being enabled after reload, which causes errors in physics-based objects or basically anywhere where I use physics-related code like phy_position_x/y or phy_active. When I look in the debugger, before the reload, room_get_info(room).physicsWorld is true. After the reload, it is false. I don't get a crash IF I destroy all physics-using objects, which is impractical. Not sure if the fixtures of those objects are also being lost. 

I need to be able to use this tool to massively speed up my level design process, but my player character and many objects use physics, so it makes it virtually impossible unless I destroy those objects first, which messes with the overall design process. I don't manually set or bind fixtures, I just use the built-in collision shape editor with physics enabled on those objects, and physics enabled in the room. 

Developer

You could tick the “use physics” checkbox in your template room, though as far as I can tell, GMLive should be calling physics_world_create and co during room setup if the room had it checked - if you can reproduce this in an empty project, email me a sample.

That worked. Sorry, wasn't aware I needed to set anything in the rm_blank for it to carry over.

Developer

You shouldn’t have to, but perhaps that’s one of those GameMaker moments with the new update - I’ll see about it next time I update GMLive.