Question by
kubawich · May 03, 2016 at 09:38 AM ·
c#unity 5scripting problemui
How to get access to other's script var with increment?
Hi, i'm trying to make ui to my game so I created UI class for handling it, and wanted to get 'points'(which is incremented each tap) var to properly show point in ui, but when i created instance of plyaer class with point var, and used 'magic' to show points with ui, it's still shows 0 as value, i used Debug.Log to check this, and it's still 0, but when i'm making this ui's stuff it player class(so just copy-paste ui's code to player class) it works properly. What may be wrong?
Comment
public Player player = new Player(); player.points;
Thanks, i just forgot about this GetComponent ;)