hi,
I just started using Corona and am trying to do something that sounds like it should be easy and I haven’t found an answer yet.
I’m creating an object, adding physics to it, then setting the gravityScale to zero so that it doens’t fall. All I want is for it to fall when I tap it but it just sits there.
I know that placing addBody in the jetMove function then setting the gravity does what I’m looking for (makes it fall on tap) but I want the object to have a physics body before I tap it.
Is it possible to change object.gravityScale once the object has been created? Thanks!!
Here’s the code:
local function jetMove(event)
jet.gravityScale = 1
print("Tapped ")
return true
end
jet = display.newImage(“jet.png”)
jet.x = 50
jet.y =75
jet:scale(.35, .35)
jet:addEventListener( “tap”, jetMove )
physics.addBody ( jet, “dynamic”, { bounce = .5, density = 3, friction = .5, shape = jetshape }
jet.gravityScale = 0