Is there a way to make physics body, but not effected by gravity?
Thanks
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Physics Body not effected by gravity
you must be new based on your question, no worries
first (i'm sure you got this) add the physics
local physics = require( "physics" )
physics.start()
then set the gravity
physics.setGravity( 0, 9.8 )
your question answer is simple, if you make you body a "static" object then it will stay and place but still be effected by collision and act like a "ground" or a "border.
here is a simple "static" setting addBody "function"
physics.addBody( ground, "static", { friction=0.5, bounce=0.3 } )
that should answer your question
also refer to the sample app under physics labeled "hello physics"
-boxie
Thanks. Static won't help me here because I have that object rotating at all the time.
Is there any other solution?
Thanks
You could make it "kinematic", its like static but it's not effected by gravity. I think that's what your looking for ;)
If you want to see it in action here you go :
1 2 3 4 5 6 | local physics = require( "physics" ) physics.start() physics.setGravity( 0, 9.8 ) physics.addBody(objectName,"kinematic") |
Static can still rotate if you felt like using obj.rotation rather than applying force or the like. (Just one option.)
Peach :)
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
Hide a Layer, A very, very new user question
Timer to change scene using Director Class *RESOLVED*
Kindle Fire config settings to deal with 20px Menu bar
Posting to Facebook
Corona Game Edition 2010.109 is now available
"Gates" or Doors
Trouble Overlay a button (or any Display Object) over a native.newVideo()
Variable Naming and Text Files
transparent display.newRoundedRect() with non-transparent border?