Last active
October 30, 2017 13:08
-
-
Save nopitech/bb654e06cd678a7b8881db2026c103b3 to your computer and use it in GitHub Desktop.
Mathf.SmoothStep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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