Physics 2D help

Hello,
I’m trying to add some basic 2Dphysics to my game but I think I’m doing something wrong as it’s not working as expected.

I have a simple sprite frame within a canvas, attached rigid body + collider and nothing is happening, I would expect the sprite to fall down or something. On top of that mass seems to be always 0, despite the values I can put in density/size.
If I add any velocity, it won’t move either (i guess cause mass is 0?).
PhysicsSystem2D.instance.enabled is set to true by default it seems but I also forced it just in case.

Any thought? (using cocos creator 3.6)

what you mean of fall down ? maybe you can refer to this to get what can do with physics : GitHub - cocos/cocos-example-physics: Samples for 3d physics

So I checked

  1. You need to use box2d physics for gravity and physics based motions, it’s documented here
  2. If you are using Preview in Editor, I just confirmed there is a bug and box2d physics is not activated in this mode, we will fix it soon. Try to preview in browser, it will work as normal

I can confirm it’s the preview editor. I didn’t do any other changes to the physics, just switching the editor made it work. Thanks for the help

@linrm All I meant is that I was expecting the character to be falling down because of gravity.

As your screenshot, you are using physic 2d builtin. It used for check collide basic. You should use box2d physic on project settings as pandamicro recommend

Hi @pandamicro ,

any update on the bugfix for the box2d physics in Editor Preview? Would be really great to be able to use the Editor Preview, as it provides more debugging functionality due to the fact, that one can inspect the scene view.