Skip to content

Instantly share code, notes, and snippets.

@nopitech
Last active October 30, 2017 13:08
Show Gist options
  • Save nopitech/bb654e06cd678a7b8881db2026c103b3 to your computer and use it in GitHub Desktop.
Save nopitech/bb654e06cd678a7b8881db2026c103b3 to your computer and use it in GitHub Desktop.
Mathf.SmoothStep
public class TestScript : MonoBehaviour
{
public float speed = 0.3f;
void Start()
{
}
void Update()
{
// 値をスムーズに
float target = Mathf.SmoothStep(transform.position.y, 10f, Time.time * speed);
transform.position = new Vector2(transform.position.x, target);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment