1

When using SKCropNode in SpriteKit, does the masking affect the physics of the node? (e.g. I crop half of the sprite, will a ball fall through the masked part of the image?) If this is the case, how would I go about creating the SKCropNode so it would crop where ever I touch?

Cheers

bwiz
  • 407
  • 5
  • 13
  • 1
    Please see this first [how-to-ask](https://stackoverflow.com/help/how-to-ask) SO is a platform where you can get a good suggestion regarding your problems. But for that, you need to be more specific about what you are asking? what have you done so far? Before asking please see the suggested SO question and take a look at them. Still, you did not find a solution then you can ask a question here. – always-a-learner Jul 20 '17 at 02:59
  • @ankitsuthar My question is does using SKCropNode on an object make it possible for physics bodies to "fall" through them. For example, if I have a ground and I mask it will the a physics body fall through the ground or will it continue to collide with it? – bwiz Jul 20 '17 at 03:37
  • my only intention is to help you regarding your question that if you put just a plain text or just dumping a code is not gone help you to get the good suggestion or answers for your problem. So my only suggestion is that add specific detail about the question, add little more description, and is it coding involved in it then you should add the code here. thanks – always-a-learner Jul 20 '17 at 03:40
  • @ankitsuthar this is a good question. please have some fractional knowledge of the tag you are commenting on [sprite-kit]. – Fluidity Jul 31 '17 at 08:29

1 Answers1

2

SKCropNode only pertains to how a node appears on the screen, it does not deal with physics bodies. You can however use SKPhysicsBody(polygonFrom:CGPath) to create a path that is identical to the body you are trying to mimic, with the gap and everything. I recommend using the program PhysicsEditor to achieve such effect. https://www.codeandweb.com/physicseditor

Knight0fDragon
  • 16,609
  • 2
  • 23
  • 44