How to make two objects rotate around the axis of one object, when connected to a spring
Hello,
I'm trying to make a small game that will be rocket league-like in space. I have started with the physics of the players ship, and used simple pre-made objects to create it.
The idea is that the blue cube is the main part of the ship, and the red surface (also a 3D cube, flattened), is some kind of "Shovel". I have attached a spring between the two (which has the blue part as parent), and the springing physics work just fine.
The problem is when I try to turn the ship around (using mouse axis). The blue part moves just fine, but the red part stays behind for a bit, then kind of "overrotates", and then moves back and forth, like a pendulum. I have tried locking the rotation or movevent of the red part, but with no effect.
How do I rotate the entire ship around one axis, without messing up the string?
Just one more thing: I use $$anonymous$$oveRotation to rotate the blue ship, not AddTorque. Hope someone can help me!
Rotation = new Vector3 (0f, Input.GetAxisRaw ("$$anonymous$$ouse X"), 0f);
rb.$$anonymous$$oveRotation(rb.rotation * Quaternion.Euler(Rotation));
This is my code, but I use the Unity String Joint Component to create the string. The code above is just for looking around.