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
2
votes
1 answer

Confusing issue adding and removing SKPhysicsJointPin upon touch

I'm having trouble with adding and removing my SKPhysicsJointPin in the touchesBegan function. The issue is that my joint is declared in the didMoveToView function because it needs to be positioned based on expressions that exists within it. That…
2
votes
1 answer

SKPhysicsJoint makes rotation not work properly

Using Swift and Sprite-Kit, I am trying to create a rope with realistic physics between the location of a static SKSpriteNode called "pin", and wherever the user touches the screen. I am doing this by adding individual SKSpriteNodes called…
Lahav
  • 781
  • 10
  • 22
2
votes
0 answers

How to make joints not rotate using sprite kit or another way of making dynamic 2d water

I want to creat a dynamic 2D water, i', following this unity…
grape1
  • 759
  • 2
  • 8
  • 19
2
votes
0 answers

Is lowerAngleLimit on SKPhysicsJointPin broken?

I have never gotten the upper/lower angle limits to work properly on SKPhysicsJointPin objects, and I think I've finally figured out why: if the lowerAngleLimit is set to a negative value, it breaks every time. It only works correctly with…
BGreenstone
  • 260
  • 1
  • 11
1
vote
1 answer

How to obtain one solid SKPhysicsBody or SKNode object from SKNodes with contact?

I'm trying to create a House Stack-like game (https://apps.apple.com/gb/app/house-stack/id1458713825?l) but having problem to assign physics mechanism. My main problem is to create a single object when Node drop and contact with others and move them…
1
vote
0 answers

Joining two nodes using SKPhysicsJointFixed in SpriteKit

I want to create a fixed connection between two nodes using SKPhysicsJointFixed. Code: let joint = SKPhysicsJointFixed.joint(withBodyA: bodyA, bodyB: bodyB, anchor: anchor) physicsWorld.add(joint) Before (without joint): After (using code…
ixany
  • 5,433
  • 9
  • 41
  • 65
1
vote
0 answers

SKPhysicsJointPin - nodes getting stuck and joints stretching

I have a couple of issues here and they may or may not be related. I have a character who is a climber and it has a torso, left arm, right arm, left hand, and right hand. Each hand has a SKPhysicsJointPin to the arm and each arm has an…
kirkage
  • 51
  • 7
1
vote
1 answer

Swift creating physics joint

I am trying to work with SpriteKit and create an elbow joint that bends to allow movement of another joint. The problem is that when I create the joint, the parts all rotate 360 degrees as I swipe across the screen to action the movement, so there…
Prateek
  • 1,724
  • 3
  • 15
  • 27
1
vote
1 answer

SpriteKit build rope function not working

Here is my code: var red: SKSpriteNode? var redHolding = false ///// // MARK: didMove ///// override func didMove(to view: SKView) { physicsWorld.contactDelegate = self if let r = self.childNode(withName: "red") as? SKSpriteNode { red = r…
Discoveringmypath
  • 1,049
  • 9
  • 23
1
vote
1 answer

How do you pass through a Spritekit joint anchor?

I have tree that is built out of a series of joints. The anchor is the base/stump of the tree. My hero is currently not able to walk through the anchor. Setting collisionBitMask = 0 isn't working for the anchor but that approach does work for the…
josh k
  • 268
  • 1
  • 11
1
vote
0 answers

How to fill in the joint gap in SpriteKit?

Lets say I have a spring joint in SpriteKit, when I pull one sprite node from another there is empty space inbetween How would I fill this space up with the same colour as the sprite nodes When I let go of the sprite node it bounces back into…
Jackster
  • 41
  • 7
1
vote
1 answer

SpriteKit joint: follow the body

I've been asked to simplify this question, so that's what I'm doing. I'm struggling in SpriteKit's physic joints (and possibly physic body properties). I tried every single subclass and many configurations but seams like nothing works or I'm doing…
Chris Rutkowski
  • 1,774
  • 1
  • 26
  • 36
1
vote
0 answers

Sk Physics Joint not working properly

I am creating a game and for my character his legs and torso have separate animations so they are separate nodes with separate physics bodies. I am having a lot of trouble linking the torso and the legs together however, linking them is not the…
gkolman
  • 189
  • 10
1
vote
1 answer

SpriteKit add a spring joint to each node

I am using SpriteKit to create a fun Hotspot UI for a project. It should be really simple! Just a background image with a load of dots on it. When you tap on a dot it scales up. When you tap again it returns to its normal size and position. But,…
Lee Probert
  • 10,308
  • 8
  • 43
  • 70
1
vote
2 answers

SpriteKit Pin Joint Stretching When Moving Attached Object

I have a rope that was created using SKPhysicsJointPin. On both ends of the rope are two different Sprites/PhysicsBodies that are attached. If I move one of the attached Sprites with an SKAction, the rope tends to pull apart and then eventually…
cheaze
  • 187
  • 1
  • 14