How to reactivate contact between two physical

I am trying to get two physicists who are already in contact with each other (in fact, they overlap because physicBody.collisionCategory = 0; for both physical devices) to restart / re-register / restart their contact, by command. I could not do this, although I tried to make body1 move one pixel inside body2 in order to reactivate the contact. I also deleted one of the physicists and re-started it a few seconds afterwards to re-call the contact. But nothing works. Is there any method or method to restart the contact process when both bodies are already in contact?

So, to make things a little clearer:

1) SpriteHuman is included in the SpritePanel.

2) - (void) didBeginContact: (SKPhysicsContact *) contact registers the contact.

3) I call a method that starts the second step again, while SpriteHuman is not moving and is still in contact with SpritePanel.

+4
source share
1 answer

You can set the BOOL property to YES for your player’s object if it is associated with a specific object. This will allow you to constantly run any code that you need to run. Remember to also set BOOL to NO when contact is lost.

+1
source

Source: https://habr.com/ru/post/1599572/


All Articles