Hi. I know I recently posted a question similar to this, but please ignore that one. It did not provide sufficient detail. Here is the new version. Anyways, in my game the player is climbing up infinitely instantiated walls. I want to delete the walls that are no longer needed. Here is the code I have so far:
using UnityEngine;
using System.Collections;
public class BrickWallTrashCollection : MonoBehaviour {
public GameObject wall;
public Transform player;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(wall.transform.position = Vector3.Distance(player.position.x + 10, player.position.y +10){
Destroy(wall.gameObject);
}
}
}
I get an error on the open bracket right after the if statement at the end. It tells me that this was an unexpected symbol. I know there are multiple things wrong with this code so can somebody please point me in the right direction? Thanks!