I am creating a game in Unity with 2D. When a button is clicked a static object is attaching a hinge joint to a dynamic object, so the dynamic object orbits it. When the dynamic object gets attached, I am setting the dynamics objects
transform.up vector to be pointing at the static object. Then, taking what ever the dynamic objects magnitude was and setting that as its velocity to the right. I do this because I want the dynamic object to orbit the planet at the same exact speed as when it wasn't orbiting.
The problem I am having, is I don't know how to determine if the object should orbit clockwise or counter-clockwise. It's easy for me to determine this when I look at an image, but I don't know how to via code.
Does anyone know how I can determine this?