Search code examples
luacoronasdkgame-physics

Is it possible to prevent an object from rotating in Corona SDK?


I guess its pretty self explainatory, I need to know if its possible to disable/prevent rotation for an object when the physics engine is enabled. The object is affected by gravity as it falls down most the time.


Solution

  • It is, simply use:

    object.isFixedRotation = true
    

    To "pause" rotation use:

    object.angularVelocity = 0
    

    at any given point.