- Home /
Platforms Oscillating with Mathf.PingPong not working properly
I have platforms Oscillating at different speeds and depths, using this statement:
transform.Translate(0,0,(Mathf.PingPong(Time.timeSinceLevelLoad, 2 Depth) - Depth) Time.deltaTime * Speed);
and after about 20 minutes, there is a noticeable difference in the height that it's oscillating at. Could anyone tell me whats wrong with the code and any possible solutions?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613091537im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Vector3.lerp and Mathf.pingpong not moving smoothly 3 Answers
C# Mathf.PingPong Rotate Back and Forth 2 Answers
Ping pong position using lerp 3 Answers
Mathf.Pingpong without the repetition!? 1 Answer
Mathf.PingPong strange behaviour 1 Answer