- Home /
jerky movement 2D
Hi,
I'm struggling with a jerky movement, I'm trying to move a ball using "Mathf.Sin"
void Update(){
Vector3 v = startPos;
v.x += Mathf.Sin (Time.time * speed);
transform.position = v;
}
any help to make the movement really smooth?
Comment
Answer by Josebeli · Jul 17, 2017 at 08:59 PM
Did you try SmoothStep?
Remember that Mathf.Sin works with radians, not degrees. I had troubles with that in the past.
I also tried $$anonymous$$athf.PingPong, but the jerky move is the same, I didn't use SmoothStep because I don't know how to use it together with $$anonymous$$athf.Sin or $$anonymous$$athf.PingPong !