Quantcast
Viewing latest article 27
Browse Latest Browse All 102

Tooltip doesn't work

Hello! Im trying to set text from Pickup script assigning variable and updating text in script on UI, but its working only on one object, on others text isn't showing. Maybe someone can see the problem? **Pickup script**: public enum Items { Garbage, Dishes, Water, Milk } void Update() { float dist = Vector3.Distance(playerTransform.position, transform.position); if (dist <= radius) { string txt = item.ToString(); displayTxt = "Press E to Collect " + txt ; if (Input.GetKeyDown(KeyCode.E)) displayTxt = ""; } else displayTxt = "" ; } **Tooltip script:** public static Text textObject; public static string textValue = ""; void Start() { textObject = GetComponent(); } void Update() { textValue = PickupItem.displayTxt; textObject.text = textValue; }

Viewing latest article 27
Browse Latest Browse All 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>