I have an object on scene and my hero should not go through it, but it should be able to go inside of it, like a boat into the bay, surrounded by the other element. I tried all kinds of physicsBody having it have body with rectangle, texture, with polygon from path, but to no avail. I was reading somewhere that it is not possible to have a concave physicsBody, but only convex. I really need it to be able to be concave. Does anyone know how to resolve this?
相关问题
- Change a SKPhysicsBody's body shape
- SKSpriteNode created from SKTexture(data:size:) is
- bodyWithEdgeLoopFromRect not working in landscape
- SpriteKit/Metal memory leak with nothing happening
- SpriteKit & Swift: Creating nodes via didBeginCont
相关文章
- How do you use SKTextureFilteringNearest with SKTe
- Can I add a border to an SKSpriteNode, similar to
- Subclassing SKShapeNode with Swift
- CGPointMake in Swift
- Modify a repeating task sequence while running
- SpriteKit - Mouse Snaps to Center On Sprite Drag
- pausing spritekit game using appdelegate in ios8
- Add ADBannerView to a SKScene
You can create a concave physics body by adding up a bunch of convex physics bodies into one shape. Then you can add them as children to an SKNode so that they stick together. there are some physics editor apps that can help you do this so you arent writing a bunch of coordinates by hand.