- Home /
Question by
juhainamtc · Feb 17, 2019 at 07:19 AM ·
update functionupdate problem
update function doesnt work at all!
hello. I am trying to make a button clickable with gazed input, however, my update function doesnt seem to work at all! here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class Level2Units : MonoBehaviour { public float gazeTime = 2f; public float myTime; private bool gazedAt;
public void update()
{
if (gazedAt)
{
Debug.Log(myTime + "true");
}
}
public void PointerEnter()
{
gazedAt = true;
}
public void PointerExit()
{
gazedAt = false;
}
there is nothing being displayed in the console at all when my pointer enter event is triggered.
Comment
Best Answer
Answer by jonathanbooker2911 · Feb 17, 2019 at 07:22 AM
Capitalize the U on update.
I spent two weeks trying to learn how getcomponent works trust me your good broseph.