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

Scene physics.add.staticBody throws when called with both width and height #6630

Closed
Legend-Master opened this issue Sep 22, 2023 · 3 comments

Comments

@Legend-Master
Copy link

Version

  • Phaser Version: 3.60.0 / 3.61.0-beta.2
  • Operating system: Windows 10
  • Browser: Chrome 117

Description

Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'getCenter')

https://github.com/photonstorm/phaser/blob/cbb802bcff470e3dc222986f5b71126d6741307c/src/physics/arcade/StaticBody.js#L612

Example Test Code

new Game({
	physics: {
		default: 'arcade',
	},
	scene: {
		create() {
			this.physics.add.staticBody(0, 0, 10, 10)
		},
	},
})

Additional Information

Probably caused by 6b55ac6

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

@Legend-Master
Copy link
Author

Thanks! I think I got the time to take a look tomorrow

@Legend-Master
Copy link
Author

Just tried the newest version on master branch, works great

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

No branches or pull requests

2 participants