Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

collision sometimes does not fire despite physic shadow showing they're are top of each other
Started by edualc May 18 2019 01:23 AM

No replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Enthusiast

  • 76 posts
  • Corona SDK

Hi all,
I have a character that needs to avoid cars.
it also need to go and touch a landmark. this landmark can also be touched by other 'things'
All of them are declared a dynamic physical objects and sensor.
I have declared a listener on the character and act when it gets hit by a car.
I have another listener on the landmark that acts when either the character or the things hit it.
works well .. most of the time. Sometimes the collision between the character and the landmark is absolutely not detected. 
I have a print at the top of the listener and the landmark listener is simply not fired.
In these cases I can see the character listener having a collision with the landmark (and i ignore it on purpose). However i'd like the code for that to be in the landmark listener
the physic shadow of the objects (in hybrid mode) are on top of each other for many seconds (and they more than 30 pixels high and wide)
scratching my head I decided to apply filters to these object collisions. collisionFilters.viewAllFilters() show them all in good order.
Filter/category 'car' is set to collide with: character
Filter/category 'character' is set to collide with: car, landmark
Filter/category 'thing1' is set to collide with: landmark
Filter/category 'landmark' is set to collide with: character, thing1, thing2
Filter/category 'thing2' is set to collide with: landmark
And the landmark listener stills ignore the collision with the character. :-(
I could probably duplicate the code for landmark/character collision (that is now only in the landmark listener) 
into the character listener so it will pick up from either listener ?
but I wonder if someone had something similar and could explain what happens ?