Moving Platforms Improvement
This commit is contained in:
@@ -95,5 +95,17 @@ namespace Platforms
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
private void OnCollisionEnter2D(Collision2D other)
|
||||
{
|
||||
if (other.gameObject.CompareTag("Player"))
|
||||
other.transform.SetParent(transform);
|
||||
}
|
||||
|
||||
private void OnCollisionExit2D(Collision2D other)
|
||||
{
|
||||
if (other.gameObject.CompareTag("Player"))
|
||||
other.transform.SetParent(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user