- Home /
Smooth platformer Movement (horizontal)
Hey there! How to make a smooth character move? (i think i must do something with math.lerp and time.deltatime) Thanks in advance
public float speed = 10;
void Move(float horizonalInput)
{
if(!canMoveInAir && !isGrounded)
return;
Vector2 moveVel = myBody.velocity;
moveVel.x = horizonalInput * speed;
myBody.velocity = moveVel;
if (!isGrounded) {
moveVel.x = horizonalInput * speed;
myBody.velocity = moveVel;
}
}
Comment
Your answer
Follow this Question
Related Questions
Map level selection slide smoothly 3 Answers
Smooth moving object 2 Answers
PlayerController Move() smoothly 0 Answers
Smooth Move script for my spaceship 0 Answers
smooth motion 1 Answer