0
votes

Currently, I'm trying to apply a force to an SCNNode using information from a swipe on the screen. Ideally, the user swipes up on the screen, (like Pokemon Go) to apply force on a node.

However, whenever I apply the force vector, it only works depending on the camera direction. Sometimes it works with the right direction, and sometimes it causes the object to go in the opposite direction.

How do I consistently apply a force so that the node to go in the direction of my swipe, regardless of camera direction?

1
How are you calculating the vector?rickster

1 Answers

0
votes

I figured out the answer. I need to get the rotation of the force vector rather than trying to do vector addition.