Hi everyone…
I’m trying to remove the physics on an object, so it will stay still, “static” not able to move it or touch it
like a normal .png image
I found out the
local actualBug1X, actualBug1Y = bug1:localToContent( 0,0 )
to detect the actual location of an image… it works!
so I have this code
-- if the bug goes out of the screen then put it back in this place so I can see it if actualBug1Y \>= 400 then bug1.x = display.contentWidth - 15 bug1.y = display.contentHeight - 200 end -- but if the bug goes to the left of the screen in this place then remove the physics -- so I won't move it anymore if actualBug1X \<= 80 then transition.to(bug1, {time=2000, x=20, y=display.contentHeight - 15, rotation = 2}) physics.removeBody(bug1, "static", {density = 1.0, friction = 0.9, bounce = 0.5, radius=10, isSensor = true}) end
But when I do that, I get the WARNING in terminal
WARNING: physics.removeBody( ) given a display object than is not a physics object
The app works fine in simulator, but I don’t like to have WARNINGS
Thanks for your help