Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MyPlayer frozen when Game scene restart or reloaded #45

Open
loveomg opened this issue Jul 1, 2022 · 0 comments
Open

MyPlayer frozen when Game scene restart or reloaded #45

loveomg opened this issue Jul 1, 2022 · 0 comments

Comments

@loveomg
Copy link

loveomg commented Jul 1, 2022

Hi everyone~
I am really happy to know this great project

Nowdays I am making custom maps for Skyoffice
Its very easy to make new maps and load them into Skyoffice

But whenever I load new maps or restart Game scene, MyPlayer frozen.. I can't move my avatar
It caused by previous MyPlayer collider and other colliders
I tried hundreds of way to remove old colliders
unfortunately, it failed...

Bellow is my codes for restart Game scene from MyPlayer.ts

this.scene.input.keyboard.resetKeys()
this.scene.input.keyboard.shutdown()      
this.scene.physics.world.colliders.destroy()  
			
//this.physics.world.removeCollider([this.myPlayer, this.myPlayer.playerContainer])
//this.physics.world.removeCollider([this.myPlayer, this.myPlayer.playerContainer], groundLayer2)
//this.physics.world.removeCollider([this.myPlayer, this.myPlayer.playerContainer], vendingMachines)
//this.physics.world.removeCollider([this.myPlayer, this.myPlayer.playerContainer], gameMachines)
//this.physics.world.removeCollider([this.myPlayer, this.myPlayer.playerContainer], doors)
			
this.scene.scene.stop('game')
this.scene.scene.restart( {
	network: network
})

How can I make my Avatart works after restart or start again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant