0
votes

I'm using Spritebuilder and I have two nodes that are using physics and I want them to just ignore each other. The two nodes are player 1 and 2, I don't want them to do anything when they collide but I still want them both to collide with other objects and so using a sensor body won't work.

Does anyone know what I can do?

1
Can you include just enough code to allow others to reproduce the problem - stackoverflow.com/help/how-to-askAndy Joiner
I'm just using the sprite builder stuff for the physics. Both sprites are in the same physics node and are both dynamic and have gravity turned on. I looked around and I don't know of any way to have two physics objects not collide unless they're a sensor or are in different physics nodes. I don't want to do either of those options though because I have other objects in the game such as the ground that I want the players to collide with. If there's some sort of way to have a sprite not collide with only one other object in code or in spritebuilder then that would be awesome.Jody K
@NoobDragNdropper : avoid using tags like xcode, swift or objective-c for questions as this ... cocos2d should be plenty of tags to attract the appropriate attention.YvesLeBorg

1 Answers

0
votes

Have a look at the docs. Basically, all you have to do is to add both nodes to the same collision group. You can do this either in Spritebuilder (in the physics properties tab) or in code.