Questions tagged [skphysicsjoint]

An SKPhysicsJoint object connects two physics bodies together so that they are simulated together by the physics world. You never instantiate objects of this class directly; instead, you instantiate one of the subclasses that defines the kind of joint you want to make. This class implements the common properties of the joint classes provided by Sprite Kit.

An SKPhysicsJoint object connects two physics bodies together so that they are simulated together by the physics world. You never instantiate objects of this class directly; instead, you instantiate one of the subclasses that defines the kind of joint you want to make. This class implements the common properties of the joint classes provided by Sprite Kit.

Click Here for Apple Docs of SKPhysicsJoint

74 questions
0
votes
1 answer

Spritekit physics destroy objects animation

is it somehow possible to destroy an object on contact? Like not just delete it from the screen with body.removeFromParent(), I would like to have an animation. I have a player and walls, and when the player has a special powerup, I want it to be…
Beginner
  • 67
  • 8
0
votes
1 answer

SKPhysicsJointFixed.joint slowing down the Sprite

I have a little game that requires a SKPhysicsJointFixed.joint and it all works, except for one the fact that the joint while it is active which is 10 seconds slows down the sprite by what seems half the speed of the sprite without the joint…
user9611921
0
votes
0 answers

The anchor point of a fixed joint is misaligned with the nodes - swift

I have a scene with two nodes one is a shape node and the other one is a sprite node. I added to the scene and define its respective physics body properties. Everything looks good until I added a new Fixed joint between the two nodes, as you can see…
0
votes
1 answer

SKPhysicsJointLimit has a elastic behaviour, but i need a strong rope simulation

i am making a experimental visual project with SpriteKit. I connected spritenodes (letter textures) with SKPhysicsJointLimit objects. I also set the maximumLenght of the joints to 35, but it is not working properly: the more force drags at the…
0
votes
1 answer

SKPhysicsJointFixed is not binding two nodes together

I'm teaching myself swift while recuperating from back surgery and everyone's help has been awesome while I'm learning swift. I apologize if this seems super simple but I figure it might help the next guy. I've read the Apple Documentation on fixed…
0
votes
0 answers

SpriteKit snake - joints and physics

I'm working on my game - Snake for iOS. My development has already passed this stage, however I think about doing some refinements to it. After several tries and errors I've totally ignored physics/movement and collision detection offered by…
Chris Rutkowski
  • 1,774
  • 1
  • 26
  • 36
0
votes
1 answer

SpriteKit how to add a fixedJoint?

I'm trying to bind two nodes together with a fixed SKPhysicsJoint I came up with this Code: var anchor = CGPointMake(hero.position.x + 10,hero.position.y) var fixedJoint = [SKPhysicsJointFixed .jointWithBodyA(hero.physicsBody!, bodyB:…
GTG101
  • 149
  • 13
0
votes
1 answer

Pinned child node not moving with its parent node

I found this problem, which sounds similar StackOverflow_24965533 but the accepted answer does not work in 9.3. Example of what I am seeing: Link To Image Here My code: func addtopMachete() { let topMacheteTexture = SKTexture(imageNamed:…
0
votes
1 answer

Swift SpriteKit - "Attempted to add a SKNode which already has a parent" while adding Joint

I'm learning SpriteKit while laid up and recovering from back surgery. I appreciate your help in helping me understand why I'm getting this error. I have a sprite "zombie1" that I can call via timer and it spawns over and over before moving across…
0
votes
1 answer

didBeginContact entering too early

I am trying to stick a ball to a spinner when they collide at the contact point. However, it seems as though the didBeginContact is being called before the contact starts. Image is below showing them both spinning together but there is a big…
Scoota P
  • 2,622
  • 7
  • 29
  • 45
0
votes
1 answer

Can I setup a SKPhysicsJoint in separate .m file (character)

I'm quite new to SpriteKit and coding in general. I am trying to setup a SKPhysicsJoint in my characters .m file. However, I can't use the physicsWorld syntax as it is not a scene. How would i get round this? I have a parent node with two children…
0
votes
1 answer

Problems with spring going Sprite Kit (It acts like a stick)

So I have a bit of a simple goal. I am just trying to have two skspritenodes go towards eachother, as if attached by an elastic band. I figured that a SKSpringJoint would be perfect for this since the documentation says that it has similar…
J.Doe
  • 1,502
  • 13
  • 47
0
votes
1 answer

SKPhysicsJointLimit EXC_BAD_ACCESS?

I'm using Sprite Kit (iOS), but whenever I try to add a SKPhysicsJointLimit to the physicsWorld, the app crashes with EXC_BAD_ACCESS (code=1, address=0xc0). Other joint types work fine, which is what's confusing me. Here's an example of what…
0
votes
1 answer

SKPhysicsJointFixed in SpriteKit and Swift

I'm making a game in Sprite Kit and Swift and I have a Sprite at the bottom of the screen and falling Sprites from the top which I want to catch and stick to the Sprite at the bottom, so I'm trying to use SKPhysicsJointFixed but when the objects…
0
votes
1 answer

SpriteKit can't change SKPhysicsJointLimit maxLength

I have a simple project where I have two SKShapeNodes with a SKPhysicsBody for each. I have a SKPhysicsJointLimit that connects them. While the program is running, I need to change the SKPhysicsJointLimit.maxLength property. However, while the…
Gliderman
  • 1,195
  • 9
  • 18