Catapult charging effect

I made a catapult object that is made of another 2 objects (head and body). The body is connected to world space with hinge joint, and I limited the angles. The head is just connected to the body with another hinge joint with limits too.

Now I try to make that whenever the player is holding the Spacebar then the catapult start to charge, im doing it by changing the body limit lower angle over time but for some reason it does not charge so smoothly as I want it too, hope someone can see the problem.

2768802--200141--arm movement.gif

And my code is here:

public class Charge : MonoBehaviour {

private HingeJoint2D hinge;
private JointAngleLimits2D hingeLimits;

void Start() {
hinge = GetComponent();
hingeLimits = hinge.limits;
}

void Update () {

if (Input.GetKey(KeyCode.Space)) {
hingeLimits.min -= 5f * Time.fixedDeltaTime;
hinge.limits = hingeLimits;
}

}

}

Thank you in advance.

Correct me if I donot understand you correctly, but those catapult actually looks okay!

What effect are you trying to achieve?
Be more specific than,

And use code tags properly!
It help a lot for us to see whats going on! :wink:

An explanation of code tags is here, by the way.

Judging by the cursor moving across the image toward the end of the loop, you captured it at a really low framerate. We can’t tell whether an animation is smooth or not if the capture isn’t smooth.

Either that, or your project is actually running at a low framerate. If that’s the case, then that’s your entire problem.

Which of these is happening?

It is 60 fps capture, so what you see is what I see in the actual editor. And how can I check the fps my game runs on?

Open the profiler view and push record. Play your scene, and see what exactly is taking up all your resources. You’ll also get an estimate of the frame rate from the graph view.