mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-11-11 04:22:40 +00:00
worked on platforms/moving platforms
This commit is contained in:
1 parent
cd92d52be2
commit
d10524a06a
7 files changed
+914
-11
No files matched your search
@@ -35,6 +35,18 @@ public class PlayerMovement : MonoBehaviour
|
||||
jump = false;
|
||||
}
|
||||
|
||||
//if colliding with platform, move with platform
|
||||
void OnCollisionEnter2D (Collision2D other) {
|
||||
if (other.gameObject.tag == "Platform") {
|
||||
transform.parent = other.transform;
|
||||
}
|
||||
}
|
||||
void OnCollisionExit2D (Collision2D other) {
|
||||
if (other.gameObject.tag == "Platform") {
|
||||
transform.parent = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ChangePos(double x, double y)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user