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

Custom SKPhysicsJoint Subclass

I'm currently working with SKPhysicsJointSpring to connect a number of nodes together. I'd like to be able to specify the force using a logarithmic formula, rather than Hooke's law. Is there a way for me to subclass SKPhysicsJoint to provide my own…
Mason
  • 271
  • 2
  • 12
0
votes
1 answer

Using SKPhysicsBody to create a vehicle

I am trying to make a vehicle (in this case a train) move based on player input. If I move the train via an SKAction, the wheels do not rotate. I could use the applyForce method on its physics body, but it I need more control. I need to make it move…
02fentym
  • 1,762
  • 2
  • 16
  • 29
0
votes
2 answers

Spritekit SKPhysicsBody pin joints

I'm trying to create a ferris wheel. It is composed of three different sprites: the base (legs), the body (circular part that rotates) and the seats (16 in total). In the code below, I added the base to the scene, then attached the body to the base…
02fentym
  • 1,762
  • 2
  • 16
  • 29
0
votes
1 answer

Swift SKPhysicsJointPin and Scene anchor point

I added a rope in my SpriteKit game and everything is ok. However, if I change the scene anchor point to (0.5, 0.5) every segment of the rope falls. If I leave it to (0, 0) everything is ok. Is there any method to make the rope work well even if I…
Eduard
  • 620
  • 9
  • 21
0
votes
0 answers

SKNode zRotation value jumps with pinned=true and allowsRotation=false

This issue is likely related to this issue. However I do not have sufficient reputation to add to that discussion. When the zRotation of a pinned node reaches (or perhaps becomes close to) positive or negative PI in the scene space, and…
Ian
  • 592
  • 5
  • 21
0
votes
1 answer

Expanding SKShapeNodes with Joint

I have two SKShapeNode nodes that I want to be attached to each other. When I tap to perform an action I want the two nodes to expand their height and upon tapping again I want them to retract. The problem is that the two nodes aren't animating as…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
0
votes
1 answer

Sprite Kit SKPhysicsJoint

I'm trying to experiment with Sprite Kit's joint system. So far, I've had difficulty making even a single strand of "string"/"rope". The end goal is to produce something like a basketball net where there will be 1 left rope (vertical), 1 right rope…
Krekin
  • 1,516
  • 1
  • 13
  • 24
0
votes
1 answer

How To Make An Extending Chain

Okay, I have had a few questions floating around stackoverflow now, and most of them are related to this one question. I've been trying to get it myself, and I have a couple of times but the result is never quite what I expected. I am trying to…
Ryoku
  • 101
  • 1
  • 8
0
votes
1 answer

How To Enforce A Pendulum Path

Okay, so I have a sprite, and I have a platform above it. The sprite starts at the point (0,scene.frame.size.height/2) and the platform at (scene.frame.size.width/2,scene.frame.size.height-10). So the sprite is on the left, and the platform is…
Ryoku
  • 101
  • 1
  • 8
0
votes
0 answers

SKPhysicsJointPin limits glitch out when character is upside down

I am creating a leg kicking motion using two physics bodies for now; a body and a leg. I use a pin joint to connect the two bodies, apply angle limits to restrict the leg movement, and apply a torque impulse to kick the leg. All works well. However,…
Andy Barnard
  • 696
  • 1
  • 5
  • 15
0
votes
2 answers

Creating an extending 'rope'

I am trying to make a game with SpriteKit where the main character shoots a 'rope' and swings through the level (Think spiderman-ish). I have no problem making the rope and having it attached to the player and different sprites but I don't really…
awnton
  • 639
  • 1
  • 5
  • 16
0
votes
2 answers

How to get SKPhysicJoint -addJoint to work on a background thread

I'm trying to load and initialize my scene on a background thread so that it doesn't pause for 4 seconds while it loads. It works just fine with one exception: I can't get SKPhysicsJointPin -addJoint to work - it crashes every time, but only if…
BGreenstone
  • 260
  • 1
  • 11
0
votes
1 answer

Why doesn't my SKSprite react to collisions when it's attached to a SKPhysicsJointPin?

In the image below you can see 3 sprites, all with SKPhysicsBodies attached to them. The red circle is a swivel point, and the blue rectangle is a "paddle" which is attached to the swivel with a SKPhysicsJointPin. The paddle works just as it…
BGreenstone
  • 260
  • 1
  • 11
-1
votes
1 answer

Swift - sprite kit - make SKPhysicsJointPin have less motion

I'm trying to create a snake with multiple body parts that moves left and right. Im using a pin, but upon the snake stopping, the body keeps moving and doesn't stop. I've messed around with the max and min angles, and the torque, but nothing seems…
Drew Wood
  • 91
  • 1
  • 10
1 2 3 4
5