i have trigger in editor it works and my wall move up but after build not working…so i install in game debug console…and i build again then when i enter trigger (in game not editor ) i see this error message:
" NullReferenceException: Object reference not set to an instance of an object
cikiskapitrigger.OnTriggerEnter ( UnityEngine.Collider other) ( at:0) "
Also here is my trigger script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cikiskapitrigger : MonoBehaviour
{
public float hiz = 1f;
public Transform doorthatmove;
public float timer;
public float sayac;
public AudioClip calinacakses;
public float ses;
AudioSource sesyeni;
public bool alreadyplayed = false;
void Start()
{
sesyeni = GetComponent<AudioSource>();
}
void OnTriggerEnter(Collider other)
{
if (!alreadyplayed&&other.gameObject.CompareTag("oyuncu"))
{
sesyeni.PlayOneShot(calinacakses, ses);
alreadyplayed = true;
StartCoroutine(Transform());
}
}
IEnumerator Transform()
{
while (doorthatmove.gameObject.transform.position.y < 12)
{
doorthatmove.gameObject.transform.Translate(0, hiz * Time.deltaTime, 0);
yield return null;
}
}
}