Fix falling through the ground on respawn
This commit is contained in:
3 files changed
+3
No files matched your search
@@ -366,6 +366,7 @@ public class AutoGamePlayer : MonoBehaviour {
|
||||
|
||||
void Respawn() {
|
||||
bird.GetComponent<RectTransform>().anchoredPosition = new UnityEngine.Vector3(0f, 64f, 0f);
|
||||
groundCollider.transform.position = new(0f, groundCollider.transform.position.y);
|
||||
bird.transform.localScale = new UnityEngine.Vector3(1f, 1f, 1f);
|
||||
rb.gravityScale = 0f;
|
||||
rb.linearVelocity = UnityEngine.Vector2.zero;
|
||||
|
||||
@@ -527,6 +527,7 @@ public class CustomGamePlayer : MonoBehaviour {
|
||||
|
||||
void Respawn() {
|
||||
bird.GetComponent<RectTransform>().anchoredPosition = new UnityEngine.Vector3(0f, 64f, 0f);
|
||||
groundCollider.transform.position = new(0f, groundCollider.transform.position.y);
|
||||
bird.transform.localScale = new UnityEngine.Vector3(1f, 1f, 1f);
|
||||
rb.gravityScale = 0f;
|
||||
rb.linearVelocity = UnityEngine.Vector2.zero;
|
||||
|
||||
@@ -314,6 +314,7 @@ public class GamePlayer : MonoBehaviour {
|
||||
|
||||
void Respawn() {
|
||||
bird.GetComponent<RectTransform>().anchoredPosition = new UnityEngine.Vector3(0f, 64f, 0f);
|
||||
groundCollider.transform.position = new(0f, groundCollider.transform.position.y);
|
||||
bird.transform.localScale = new UnityEngine.Vector3(1f, 1f, 1f);
|
||||
rb.gravityScale = 0f;
|
||||
rb.linearVelocity = UnityEngine.Vector2.zero;
|
||||
|
||||
Reference in new issue
Block a user