using UnityEngine;
using System.Collections;
public class PlatformDestroyer : MonoBehaviour {
public GameObject platformDestructionPoint;
// Use this for initialization
void Start () {
platformDestructionPoint = GameObject.Find ("PlatformDestructionPoint");
}
// Update is called once per frame
void Update () {
if(transform.position.x < platformDestructionPoint.transform.position.x)
{
Destroy (gameObject);
}
}
}
![alt text][1]
[1]: /storage/temp/67821-screenshot-2016-04-11-172234.png
Hello, I am a complete beginner to Unity and am trying to learn by following a 2d endless runner tutorial. So far it has been well, but when trying to create a script that destroys platforms after my character passes by I keep getting an error message. It has something to do with line 16 of my code and I have no idea what it means or how to fix it. Please help me to fix my problem. Thank you!
↧