> For the complete documentation index, see [llms.txt](https://docs.streamavatars.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/classes/objectphysics/layer-get-set.md).

# layer {get;set}

```lua
return function()
    local app = getApp();
    local myObject = app.createGameObject();
    wait(3);
    myObject.physics.addBoxCollider();
    myObject.physics.hasRigidBody = true; --creates a rigidbody on the object.
    
    myObject.physics.layer = 'ground+avatars';
    --myObject.physics.layer = 'ground';
    --myObject.physics.layer = 'unique';
    
    log(myObject.physics.hasRigidBody);
    
    --as soon as the script ends the object will be destroyed automatically.
    keepAlive();
end
```
