Is there any way to keep a “dynamic” sensor object in place without it falling off the screen???
I know it is theoritically impossible… but I would love any work around solutions please…
[import]uid: 64174 topic_id: 12392 reply_id: 312392[/import]
Is there any way to keep a “dynamic” sensor object in place without it falling off the screen???
I know it is theoritically impossible… but I would love any work around solutions please…
[import]uid: 64174 topic_id: 12392 reply_id: 312392[/import]
Why not just make it a static sensor?
[lua]physics.addBody( YOUR_OBJECT, “static”, { isSensor = true} ) [/lua] [import]uid: 7366 topic_id: 12392 reply_id: 45160[/import]
So you just want a work around…right ?
don’t complain that this code is not efficient…
try this
[lua]local physics = require(“physics”)
physics.start()
physics.setGravity( 0, 9.8 )
local cueball = display.newImage( “ball_white.png” )
physics.addBody(cueball)
cueball.x =50
cueball.y = 50
local function setball()
cueball.x =50
cueball.y = 50
end
timer.performWithDelay(10, setball, 0)[/lua] [import]uid: 71210 topic_id: 12392 reply_id: 45162[/import]
Hi,
Thanks for the answers 
A had actually found another way.
[lua]local onEnterFrame = function(event)
cueball.x = 50
cueball.y = 50
end
Runtime:addEventListener(“enterFrame”,onEnterFrame)[/lua]
Almost similar to your solution I think… Thanks anyway! [import]uid: 64174 topic_id: 12392 reply_id: 45164[/import]
Ha ha… I always comes out with complecated solutions even when there are simple ones. [import]uid: 71210 topic_id: 12392 reply_id: 45173[/import]
how about this
local physics = require “physics”
physics.start()
circle = display.newCircle(100,100,50)
physics.addBody(circle,{isSensor = true})
circle.linearDamping = 100 – make it high [import]uid: 12482 topic_id: 12392 reply_id: 46367[/import]