Hi,
I’m very new to Unity and have a question for my school project.
At the top of my Unity 2D scene, there is a hook which needs to have a natural swing left to right. I tried to handle this by adding a hingeJoint to the top of the hook and then applying a velocity to rigidbody2D.
[21588-screen+shot+2014-02-02+at+23.45.25.png|21588]
My problem is sending the hook to the down when played clicked on the space button on the keyboard. Because, the hook is always swinging, when the space button has clicked, it should go to the correct direction depending on the looking direction of the hook and then should come back after touching to the end of the camera view.
I’ve spent hours on internet in order to find a method to determine correct vector to go down and then go up but all of the examples I could found were about calculating the vector between two known points. In this scenario, I don’t have the direction point but only the angle of the transform.
Any help will be appreciated.
Another point: At the moment, when player has clicked on the space button, I am disabling the hingeJoint and converting the body to a kinematic object in order to be able to change the location of the hook to the down. I also appreciate if you have another idea about this part.