Using Angular Impulse to launch at angle

I’m trying to launch an object at an angle using Corona physics. The idea behind this is to let the player choose an angle for the char object and then the object launches at that angle. However, when I use Angular Impulse, the char object just flips over.

Is there a way to launch the object at an angle and make it go straight?

[code]
local physics = require(“physics”)
physics.start()
physics.setDrawMode( “hybrid” )

local ground = display.newRect(0,610,750,50)
ground:setFillColor(140, 140, 140)
physics.addBody( ground, “static”, { friction=0.5, bounce=0.3 } )

char = display.newRect(0,0,50,150)
char.x = 250;
char.y = ground.y - 85;
physics.addBody( char, “kinetic”, { friction=0.5, bounce=0.3 } )

local function listener( event )
print( “listener called” )
char:applyAngularImpulse( 80 )
end

timer.performWithDelay( 2000, listener )

[/code] [import]uid: 14218 topic_id: 13826 reply_id: 313826[/import]

not sure I understand what you mean.

but if you want the object to launch you need to use
char:applyLinearImpulse

char:applyAngularImpulse will make the object rotate: [import]uid: 13632 topic_id: 13826 reply_id: 50769[/import]

try replacing: char:applyAngularImpulse( 80 )
with:
char:applyLinearImpulse( 5, 10, char.x, char.y )

where 5 and 10 are the impulse forces in the x and y directions.
you can calculate these forces from an angle with cosinus and sinus calculations [import]uid: 13632 topic_id: 13826 reply_id: 50773[/import]