Falling object rotation problem

Hi,

When a physics body falls fro a height, it spins out of control. It is possible for me to make the physics body stay put as such even when falling?

I have the following code…

[lua]local physics = require “physics”
physics.start()
physics.setGravity(0, 100)

function load()
ground = display.newRect(0,100,200,64)
physics.addBody(ground,“static”,{density = 10, friction = 0, bounce=0})
man = display.newRect(0,40,64,64);
physics.addBody(man,{density = 10, friction = 0, bounce=0})
end

local move = function()
man.x = man.x + 10
end

load()
Runtime:addEventListener(“enterFrame”, move)[/lua]

How do i make the smaller square fall without spinning? [import]uid: 64174 topic_id: 12161 reply_id: 312161[/import]

So you don’t want the man to rotate at all?

local physics = require "physics"  
physics.start()  
physics.setGravity(0, 100)  
   
function load()  
 ground = display.newRect(0,100,200,64)  
 physics.addBody(ground,"static",{density = 10, friction = 0, bounce=0})  
 man = display.newRect(0,40,64,64);   
 physics.addBody(man,{density = 10, friction = 0, bounce=0})   
 man.isFixedRotation = true --Prevents object from rotating  
end  
   
local move = function()  
 man.x = man.x + 10  
end  
   
load()   
Runtime:addEventListener("enterFrame", move)  

Try adding that [import]uid: 31262 topic_id: 12161 reply_id: 44248[/import]

Aw! I Should have read the docs properly :slight_smile: Thanks a lot anyway!! :slight_smile: [import]uid: 64174 topic_id: 12161 reply_id: 44250[/import]