When I am creating a .sks
scene in Xcode
, I often need two nodes at the exact same x
or y
position to create a wall. I add rectangular physics bodies. They both have no friction whatsoever.
When I make a spritenode
move over these collision bodies (I am using an impulse to the physics body) it acts as if there is a barrier between the two rectangles and I need to 'push' the node or make it jump to get over a boundary.
As I stated, these nodes are perfectly in line with each other so nodes should be able to flow past them smoothly.
Any suggestions?
If you need any code/pictures I am using, please ask.
Edit: The answer
My problem was the collision platforms were colliding with each other, and so they were slightly pushed out by on the generation of all platforms.
The way to solve is to set these following values on the platforms:
categoryBitMask
to 1
collisionBitMask
to 4294967294
which basically means they won't collide with each other.
Still new to swift
, good to keep learning :P
categoryMask
,collisionMask
, etc. your are setting each node to. – George