Player Movement and SurfaceEffector2D
Hello.
I have a conveyor belt with SurfaceEffector2D attached to it.
And a Person with rigidbody2D...
and horizontal movement of my person is changed by person's rigidbody2D.velocity
just like this:
rigidbody2D.velocity = new Vector2(h*WalkSpeed, rigidbody2D.velocity.y);
where h is the value for horizontal axis
but it blocks the force that give surfaceEffector2D to person (by update the person's velocity).
Than i try to use rigidbody2D.AddForce(), so i must limit the person's speed by condition
if (Mathf.Abs(rigidbody2D.velocity.x)<walkSpeed)
rigidbody2D.AddForce( new Vector2(accel*h,0));
so this is not suitable because
i got jerking motion (velocity.x value is 1-2-3-1-2-3-1-2-3 etc)
it blocks SurfaceEffector's force too because person doesn't accelerating on the conveyor - he can't reach the speed greater than his walkspeed (only when he walk, when he stay he can reach any speed)
i always can use the Transform.Translate(), but this is not good idea because i want change animation according person's velocity
So how i must organize movement of my person to not conflict with my SurfaceEffector?
Your answer
![](https://koobas.hobune.stream/wayback/20220612084731im_/https://answers.unity.com/themes/thub/images/avi.jpg)