- Home /
Question by
LAiKA787SV · Jun 05, 2013 at 04:05 PM ·
gameobjectreferencenulladdcomponentwrapper
Null Reference at (wrapper managed-to-native)
What do they mean ?
So i was build a game and give it to my friend. I play it here was okay, no problem, no (wrapper managed-to-native), but when he play in his computer, he always got this messages and the game starts crazy (sometimes the object disappear, and appear). We use same Processor (Intel), same Graphic Card (nVidia), and same OS (Windows 7)
This is what i got from his OutputLog
NullReferenceException
at (wrapper managed-to-native) UnityEngine.GameObject:Internal_AddComponentWithType (System.Type)
at UnityEngine.GameObject.AddComponent (System.Type componentType) [0x00000] in <filename unknown>:0
at AIKart.ReleaseNitro () [0x00000] in D:\Black Samba\NitroRacerXD\Assets\SKIPPER\Skript\CORE\AIKart.js:463
at AIKart+$UseWeaponNos$425+$.MoveNext () [0x001b7] in D:\Black Samba\NitroRacerXD\Assets\SKIPPER\Skript\CORE\AIKart.js:1047
And this is the script
function ReleaseNitro(){
newNitroTrailer.AddComponent(KillYou);
newNitroTrailer.GetComponent(KillYou).lifeTime = 6;
useNitro = false;
nosObject.SetActive(false);
nosObject.audio.clip = null;
maxSpeed = awakeMaxSpeed;
}
function UseWeaponNos(howMuch : int){
newNitroTrailer = Instantiate(nosObject,nosObject.transform.position,nosObject.transform.rotation);
newNitroTrailer.SetActive(true);
newNitroTrailer.GetComponent(TrailRenderer).enabled = true;
useNitro = true;
maxSpeed = 10000;
nosObject.SetActive(true);
nosObject.GetComponent(TrailRenderer).enabled = false;
nosObject.audio.clip = sfx[0];
yield;
usableNitro = false;
if(!nosObject.audio.isPlaying && nosObject.audio.clip != null && usableNitro)nosObject.audio.Play();
yield new WaitForSeconds(howMuch);
useNitro = false;
usableNitro = true;
ReleaseNitro();
}
Please help. Thanks for any answers.
Comment