Aligning a node with a PhysicsPolygonCollider

I’m trying to align a node with a sprite and a PhysicsPolygonCollider to the borders of the screen. The sprite aligns to the borders when I attach a Widget component. However, the PhysicsPolygonCollider does not seem to get stretched as the sprite does.

What’s a solution for this? My test device is a Huawei Honor 8x and when I use cc.winSize I get 1920x1080 which is not the resolution of the device. Also, if I get the canvas width, the result is the same and if I get the scaleX of the node the result is 1.

How can I get my PhysicsPolygonCollider to align to the border in the same way that the sprite does?

Thank you for any help.

@cabronious what version of Creator are you using? Can you provide a demo that reproduces the problem?

I am using 2.4.3.

Example Project with Issue

In the example project, you can see the issue if you choose the Apple iPhone X as the simulator for example.

It is a problem, physics component was deserialize before canvas widget work and setup with a wrong world position. I suggest you put the world thing into a prefab, and it will do a loading and bypass this issue. this is the (386.0 KB)

1 Like

Thanks for the help.

Will this be an issue in Cocos Creator 3.0?