variable isSensor

Is there a way to have an object act as a sensor for one object while still interacting with another object?
The issue I’m having is when I make the objects sensors they fall through the floor… I’d like them to maintain contact with the floor but not each other. [import]uid: 15663 topic_id: 15732 reply_id: 315732[/import]

It really depends on what you are doing - can they be static? Or no?

Is there a reason this is in the CoronaUI forum? [import]uid: 52491 topic_id: 15732 reply_id: 58162[/import]

They can’t be static because I want them to move on their own. Basically, I want the main character to be able to loose health when he first contacts the enemy but then have an invulnurable period where he could walk through the enemy.

Sorry for miscategorizing this question. [import]uid: 15663 topic_id: 15732 reply_id: 58199[/import]

Take a look at the API (at body types);
http://developer.anscamobile.com/content/game-edition-physics-bodies

You may want to make the enemies kinematic sensors. The hero could then pass through them. (Even if you just switch them to kinematic then back to dynamic, or the like.)

Peach [import]uid: 52491 topic_id: 15732 reply_id: 58337[/import]

wow, i was just trying to figure out how to do what you originaly posted for.
i havent put any code into place but here is what might help us solve the problem
of the object “falling” through the platform.
what we have

thePlatform object - mine is moveable via touch so I cant make this “static”
thePlatform object - can be “dragged” up or down or the corners raised(making it a diaganal line).

theBall object - it rolls around on the platform.

slickSpot object - when the ball touches this is appies a momentary Linear force in the direction/angle it was “already” going.

theHole - when the ball touches this, it disappears into the hole and game then level restarts.

my problem was that using slickSpot as a sensor, would work but theBall would not go through it.

so I changed theBall.isSensor status to true, thus allowing theBall to go through the slickSpot BUT
I was not getting the constistant “pass” through effect that I wanted. PLUS theBall was dropping through the platform.

So how am I going to fix it ? at the “moved” phase of thePlatform, Im gonna make
thePlatform.body = static (temporarily)
theBall.isSensor = true
applyLinearForce to theBall (according to my game logic)
theBall.isSensor = false
thePlatform.body = kinematic(not it can be dragged again)

after I read peach’s response of making your platform “static”, I could make mine temporaily
“static” then switch it back to body = “kinematic”. my slickSpot is just a few pixels, so i hope this works !!!

so darklordofphysics what was your work-around for this “pass-through” effect ?

[import]uid: 11094 topic_id: 15732 reply_id: 70869[/import]

Or maybe collision filters would be the ideal solution ? [import]uid: 84637 topic_id: 15732 reply_id: 70900[/import]