Hi everyone,
I quite confused because, my project is running well in editor runtime, but when I build it for PC, most of logic doesn’t work. I checked the log of build and there is error message in it:
NullReferenceException: Object reference not set to an instance of an object
at LightSaboteur.Awake () [0x00000] in filename unknown:0
(Filename: Line: -1)
Platform assembly: D:\Art\GameProjects\Builds\4_Data\Managed\Boo.Lang.dll (this message is harmless)
NullReferenceException: Object reference not set to an instance of an object
at LightSaboteur.Update () [0x00000] in filename unknown :0
(Filename: Line: -1)
NullReferenceException: Object reference not set to an instance of an object
at LightSaboteur.Update () [0x00000] in filename unknown :0
(Filename: Line: -1)
There is a code:
using UnityEngine;
using System.Collections;
public class LightSaboteur : MonoBehaviour {
CharacterSettings charSettings;
public GameObject debug;
Debuger debuger;
WeaponManager weapon;
Interactions interactions;
public GameObject testPoints;
public GameObject aimingObject;
//Equipment eq;
void Awake()
{
charSettings = gameObject.GetComponent<CharacterSettings>();
weapon = new WeaponManager();
charSettings.Equipment.Weapon = weapon.buildWeaponByType((int)WeaponType.GigasLightPoliceRifle);
charSettings.DelayDistance = 30f;
charSettings.CloseDistance = 10f;
charSettings.StopDistance = 7f;
charSettings.NormalSpeed = 7f;
charSettings.ChaseSpeed = 20f;
charSettings.setAttackDistanceRange(10f, 30f);
charSettings.addPatrollingArea(testPoints);
charSettings.AimingObject = aimingObject;
charSettings.Constitution.HealthPoints = 100;
charSettings.Constitution.ArmorPoints = 20;
interactions = gameObject.AddComponent<Interactions>(); //charAnimation = gameObject.AddComponent<CharacterAnimation>();
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
interactions.act();
}
}