Quantcast
Viewing all articles
Browse latest Browse all 94

Sample Assets FP bobbing

I've got a problem with the FP camera from the Sample Assets, if i walk over a plane it's fine but if I walk over a terrain it judders (video below). The problem is in this code // vertical head position "spring simulation" for jumping/landing impacts springVelocity -= velocityChange.y; // input to spring from change in character Y velocity springVelocity -= springPos*springElastic; // elastic spring force towards zero position springVelocity *= springDampen; // damping towards zero velocity springPos += springVelocity * Time.deltaTime; // output to head Y position springPos = Mathf.Clamp( springPos, -.3f, .3f ); // clamp spring distance // snap spring values to zero if almost stopped: if (Mathf.Abs(springVelocity) < springVelocityThreshold && Mathf.Abs (springPos) < springPositionThreshold){ springVelocity = 0; springPos = 0; } If I turn down the springDampen it stops but the effect is lost. Has anyone came across this problem or know why this would happen over terrain? Cheers. [VIDEO][1] [1]: https://www.youtube.com/watch?v=MkldjtHgNws

Viewing all articles
Browse latest Browse all 94

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>