Hi,
I have my player’s physics set to isSensor=true so that they can pass through each other, but now how do i stop them from passing through the walls?
Thank You!
Hi,
I have my player’s physics set to isSensor=true so that they can pass through each other, but now how do i stop them from passing through the walls?
Thank You!
the isSensor value doesn’t allow you to filter collisions. You might want to use the collision filter chart if you have selective collision needs:
http://forums.coronalabs.com/topic/2128-collision-filters-helper-chart/
You should probably do some collision filtering instead:
http://docs.coronalabs.com/guide/physics/collisionDetection/index.html#filtering
I am already using collision filters but i want to use isSensor aswell. Possible?
isSensor isn’t a “smart” value, meaning it’s either “on”, or “off”. So if you want an object to collide with some things but not others, the collision filtering option is right for you. You cannot tell the isSensor value to differentiate between physics objects.
Hi @coolromin,
You may experiment with the pre-collision “contact”, which allows you to manage the collision right before it happens. In this way, you may be able to keep them as normal non-sensor objects, but ignore the collision event when they collide with each other. You’ll just need to experiment with the behavior… this tutorial should get you started:
http://www.coronalabs.com/blog/2012/11/27/introducing-physics-event-contact/
Brent
the isSensor value doesn’t allow you to filter collisions. You might want to use the collision filter chart if you have selective collision needs:
http://forums.coronalabs.com/topic/2128-collision-filters-helper-chart/
You should probably do some collision filtering instead:
http://docs.coronalabs.com/guide/physics/collisionDetection/index.html#filtering
I am already using collision filters but i want to use isSensor aswell. Possible?
isSensor isn’t a “smart” value, meaning it’s either “on”, or “off”. So if you want an object to collide with some things but not others, the collision filtering option is right for you. You cannot tell the isSensor value to differentiate between physics objects.
Hi @coolromin,
You may experiment with the pre-collision “contact”, which allows you to manage the collision right before it happens. In this way, you may be able to keep them as normal non-sensor objects, but ignore the collision event when they collide with each other. You’ll just need to experiment with the behavior… this tutorial should get you started:
http://www.coronalabs.com/blog/2012/11/27/introducing-physics-event-contact/
Brent