Disable physics in a layer [Dusk]

Hi there,

after working hour for hour to convert my old game to Dusk Engine  I’m on a good way :slight_smile:

The problem: I made a map in Tiled, I’m using two layers with the same tiles (working, no problem), but …

I added some physics to the tiles, and now the physics is on every layer - but I want to disable it on Layer two (“BG”). One time it works, but after moving the tiles every layer get’s his physics back. Any Idea?

Thank you for every idea…

Anthony

Dusk handles physics in a hierarchy - if a tile says it has physics, it takes precedence over a layer’s physics designations. You could try setting isBodyActive on all tiles in your layer:

tiles:isBodyActive : false
  • Caleb

HI Caleb - thank you!

Yes, it works - but only one time - after culling (?) it’s active again. I added the physics in Tiled - maybe this is the problem? If I would add the physics part later in Corona I could choose the layers - but… This would be the same problem - after culling everything will be gone. Ahhhhhh! The best solution for me would be disable permanently the physics in a layer.

Anthony

I mean set the physics on your tiles, then, on the layer physics needs to be disabled on, add the property “tiles:isBodyActive” and set it to false. The tile bodies will still be made, but because of the Corona property isBodyActive they won’t collide with anything else.

  • Caleb

Ok - thank you - I’ll give it a try!

-Anthony

Dusk handles physics in a hierarchy - if a tile says it has physics, it takes precedence over a layer’s physics designations. You could try setting isBodyActive on all tiles in your layer:

tiles:isBodyActive : false
  • Caleb

HI Caleb - thank you!

Yes, it works - but only one time - after culling (?) it’s active again. I added the physics in Tiled - maybe this is the problem? If I would add the physics part later in Corona I could choose the layers - but… This would be the same problem - after culling everything will be gone. Ahhhhhh! The best solution for me would be disable permanently the physics in a layer.

Anthony

I mean set the physics on your tiles, then, on the layer physics needs to be disabled on, add the property “tiles:isBodyActive” and set it to false. The tile bodies will still be made, but because of the Corona property isBodyActive they won’t collide with anything else.

  • Caleb

Ok - thank you - I’ll give it a try!

-Anthony