- Home /
A ball and spring - multiple degrees of freedom
I'm trying to create a ball and spring effect, where a ball attached to a spring pops out of a box. I've figured out this in one dimension using the spring joint, and this snippet for "adjusting" the size of the spring" (fudging a bit, the extra length is "below the floor"):
var ballT:Transform; function Update () { transform.localScale.y = Mathf.Abs(ballT.position.y) - (ballT.localScale.y*ballT.lossyScale.y/2)/transform.lossyScale.y; }
I'm wondering how would I create a spring with more than one degree of freedom?
1) Some sort of mesh along spline manipulation for the spring?
2) How would the spring joint work for multiple dimensions - where the spring is soft enough to "bend over" and skew?
Your answer
Follow this Question
Related Questions
Create the visual spring in Unity? 3 Answers
Adding extra materials to a mesh programmatically 0 Answers
UV Mapping a Sphere at runtime 1 Answer
Unity isn't reading the mesh I created 1 Answer
How to texture walls in procedurally generated mesh? 1 Answer