I set the concept of my game to see the two different world and you can go either world by pressing key code.Tab. So when seeing world1, world2 are invisible and can't affect the player. but the problem is when swapping on to other world if player are inside an wall or an object player get stuck inside of it so I want the player to be pushed out of the object that got stuck to it. I tried googling up for an answer but preventing getting stuck from objects that regenerate randomly but that wasn't my case.
It will be pleasure if anyone can give even an idea on how to solve the problem.
Here is the video resource might help you understand my problem. https://www.youtube.com/watch?v=cGz-4gUD-bw sorry for the bad resolution.