ground bug fixed

This commit is contained in:
2023-02-28 13:31:31 +01:00
parent f594e3e415
commit 1cf316e00c
4 changed files with 55 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ public class GroundController : MonoBehaviour
public GameObject[] sideObjects;
public float groundMoveSpeed = 10f;
private CollectibleSpawner cs;
//private CollectibleSpawner cs;
private void Awake() {
//cs = FindObjectOfType<CollectibleSpawner>();
@@ -83,6 +83,6 @@ public class GroundController : MonoBehaviour
private void CreateNewGround(){
int random = UnityEngine.Random.Range(0, loadFrom.Length);
//ketto modullal elobb tolt be, annak az iranyanak megfeleloen, +80 a ket modull hossza
Instantiate(loadFrom[random], new Vector3(0,0, ground[ground.Length-2].transform.position.z + 80), ground[ground.Length-2].transform.rotation);
Instantiate(loadFrom[random], new Vector3(0,0, ground[ground.Length-1].transform.position.z + 40), ground[ground.Length-1].transform.rotation);
}
}

View File

@@ -0,0 +1,13 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WallCollision : MonoBehaviour
{
private void OnTriggerEnter(Collider other) {
if(other.gameObject.tag == "Player"){
Debug.Log("neki ment a falnak");
Application.Quit();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c504cad2318bb1e33bb50a99fd60a73f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: