In my project, I have a node that is moved forward (by applyForce) upon touches began. I would like the object to only move in one direction (z) and never rotate (x). However, when the object hits a body that is at an angle to it, it bounces back at an angle, as would be expected under normal physics.
Ideally, I want it to stop moving on collision and not rotate.
I have already set the physics body's restitution to 0 to prevent a bounce (but it still bounces), and its angular damping to 1.0 to prevent rotation (but it still rotates.) Any other ideas on how I can prevent rotation upon object collision?
cubeNode.physicsBody?.restitution = 0
cubeNode.physicsBody?.angularDamping = 1.0