pod by irwatts 2020-05-06T23:16:14Z
Really nice concept and beautiful graphics! But quite janky physics. I've done similar things before myself. I don't understand why the the main body sometimes acts very un-physically, when you jump it flies in a very awkward way and you'd expect that it should behave like a free-falling body. Are you maybe setting leg rotations through the transform and not through joint motors?
Btw, when you change the amplitude, the "reference point" doesn't change and hence the leg will immediately jump to the target location as if the frequency is measured from 0. The only way to "safely" change frequency is to reduce amplitude to 0, then change frequency, then change amplitude back to desired. Instead, I suggest you should move the reference point as well. For example you could track time yourself and add delta time * frequency each frame. Then the position will be preserved when you change amplitudes.
I assume it's currently something like this: ``` legAngle = sin(game.time * frequency); ```
Instead, you should do something like: ``` float legTime = 0;
// in update: legTime += game.deltaTime * frequency; legAngle = sin(legTime); ```