Skip to content

Instantly share code, notes, and snippets.

@am1tanaka
Created April 8, 2018 14:32
Show Gist options
  • Select an option

  • Save am1tanaka/5e3680376a2835b5355dc1baebe2ac88 to your computer and use it in GitHub Desktop.

Select an option

Save am1tanaka/5e3680376a2835b5355dc1baebe2ac88 to your computer and use it in GitHub Desktop.
頭がぶつかったら即落ちてくるようにするコード
private void OnCollisionEnter2D(Collision2D collision)
{
if ((m_MoveVector.y > 0f) && (collision.gameObject.GetComponent<PlatformEffector2D>() == null))
{
m_MoveVector.y = 0f;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment