Cocos Creator version
3.8.8
System information
Microsoft Windows 11 Pro 10.0.26200
Issue description
Can not get CircleCollider2D.worldRadius when using Box2D-wasm. Getting error ("Relevant error log output" is provided).
Relevant error log output
TypeError: B2.CircleShapeGetRadius is not a function
at B2CircleShape.get (circle-shape-2d.ts:35:19)
at CircleCollider2D.get (circle-collider-2d.ts:69:50)
at script.update (script.ts:12:53)
at component-scheduler.ts:299:35
at ReusableInvoker._invoke (component-scheduler.ts:251:13)
at ReusableInvoker.invoke (component-scheduler.ts:213:14)
at ComponentScheduler.updatePhase (component-scheduler.ts:504:28)
at Director.tick (director.ts:780:37)
at Game._updateCallback (game.ts:1086:22)
at Pacer.updateCallback [as _callback] (pacer-web.ts:95:22)
Steps to reproduce
- Create new project.
- In
Feature Cropping -> 2D -> 2D Physics System set Box2D-wasm Based 2D Physics System
- Create scene with circle sprite and RigidBody2D and CircleCollider2D components (example project is provided)
- Add script to this object with such update method implementation:
update(deltaTime: number) {
var circleCollider2DComponent = this.node.getComponent(CircleCollider2D)
var worldRadius = circleCollider2DComponent.worldRadius
console.log("worldRadius: " + worldRadius)
}
- Click "Play" button (run Preview in Browser)
Minimal reproduction project
box2dwasm-error.zip
Cocos Creator version
3.8.8
System information
Microsoft Windows 11 Pro 10.0.26200
Issue description
Can not get CircleCollider2D.worldRadius when using Box2D-wasm. Getting error ("Relevant error log output" is provided).
Relevant error log output
TypeError: B2.CircleShapeGetRadius is not a function
at B2CircleShape.get (circle-shape-2d.ts:35:19)
at CircleCollider2D.get (circle-collider-2d.ts:69:50)
at script.update (script.ts:12:53)
at component-scheduler.ts:299:35
at ReusableInvoker._invoke (component-scheduler.ts:251:13)
at ReusableInvoker.invoke (component-scheduler.ts:213:14)
at ComponentScheduler.updatePhase (component-scheduler.ts:504:28)
at Director.tick (director.ts:780:37)
at Game._updateCallback (game.ts:1086:22)
at Pacer.updateCallback [as _callback] (pacer-web.ts:95:22)
Steps to reproduce
Feature Cropping -> 2D -> 2D Physics SystemsetBox2D-wasm Based 2D Physics SystemMinimal reproduction project
box2dwasm-error.zip