- Home /
Only error comes when try to build for android not for windows?
Code:
var a:UI.Image;
var b:Sprite;
var c:Sprite;
function Start () {
a=GetComponent.<UI.Image>();
}
function Clicked() {
a.sprite=b;
}
function Released(){
a.sprite=c;
}
error: {1}NullReferenceException: Object reference not set to an instance of an object
{2}Error building Player: NullReferenceException: Object reference not set to an instance of an object
i don't think its a problem in code.
I have added sdk tools and jdk in the external tools section.
Well, this is likely becuase UI.Image
doesn't exist.
You need to use UnityEngine.UI.Image
Your answer
Follow this Question
Related Questions
I need help with a CharacterMotor script error in Unity5. This is formatted in Javascript. 0 Answers
BCE0019 "enabled" is not a member of "Object"(On JavaScript Script) 2 Answers
How do perform the operations as per the commands at client side in socket unity? 0 Answers
Mini Game Timer - Unity 2017 0 Answers
Why am I only allowed to trigger my dash script once? 2 Answers