Tilemap collision problem, please help

Hello everyone, I’m a beginner at Defold and know very little. I am creating an rpg and I have a problem - I made a level using tilemap collision, then created a proxy and going to the next level. But the collision with the ground and the stairs remained from the previous level, and on the new level, the collision with the new map did not load. Already looked everywhere about this topic, but nothing helped.


Here is the proxy code:

    function on_message(self, message_id, message, sender)
	if message_id == hash("show_level2") then
		msg.post("#level2proxy", "load")
		msg.post("#level1proxy", "unload")
	elseif message_id == hash("proxy_loaded") then
		print("proxy_loaded", sender)
		msg.post(sender, "enable")
		print(sender)
	elseif message_id == hash("proxy_unloaded") then
		print("proxy_unloaded", sender)
	end
end

Thanks in advance

The code looks good. Are there any errors in the console?

There must be something else wrong. The fact that the collisions still register from the previous level is strange.

Can you share the project?

I was unable to upload the project to GitHub, so I downloaded the archive.
I would be very grateful if you could explain how to do it correctly.
https://github.com/PaladinLeeroy/DefoldPlatformer

in your level 2 collection you still have the level 1 collision selected as your collision shape

5 Likes

Thank you very much, this is my mistake :sweat:

1 Like