I want all my objects but one to be affected by gravity. Is there a way to void it out for a certain object?
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Allow A Object To Not obey Gravity
You can set bodyType to "static" or "kinematic".
http://developer.anscamobile.com/reference/index/bodybodytype
Or you can just not add a physics body to it.
The problem with that is that if you make one object kinematic or static, you run into problems with the object not colliding with other objects anymore.
For example, if you have a bunch of static objects that define the walls or terrain in a game, and you want your flying object to not respond to gravity, and you set it as kinematic, it'll pass through the terrain.
It's not impossible to solve the problem, but it requires a lot of extra work compared to if you could just have a "respondsToGravity=false" flag...
An alternate solution would be to keep things dynamic, but turn off gravity and simulate gravity by adding a force in each enterFrame
good luck!
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
Screen flashing on scene change
OOP - error using display group as container object? - object:insert(sprite) fails
New Corona SDK Release!
"Gates" or Doors
math.random
audio.stop() and scratchy sounds
How to remove lines around sprites exported from Spriteloq
Kunundrum is live!
Director Class Error when selecting picture from library.