|
I was going through the tornadotwins tutorials on youtube, and for some reason their scripts keep giving me errors? I solved most of them but 2, a Missing Method Exception and Null Reference Exception. The Missing Method Exception applied to my Turret control script, heres the script } And the error:
The next is a NullReferenceException for my MoveAround Script, heres the script, It took a while to get a solution for this. I dont know why the scripts arent working for me, they seem to work fine for most people... And le error... NullReferenceException UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, Vector3 pos, Quaternion rot) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/BaseClass.cs:46) UnityEngine.Object.Instantiate (UnityEngine.Object original, Vector3 position, Quaternion rotation) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/BaseClass.cs:57) MoveAround.Update () (at Assets/Scripts/MoveAround.js:15)
(comments are locked)
|
|
MissingMethodException: Method not found: 'UnityEngine.Rigidbody.Addforce' The correct is AddForce, with "F" and not "f". ... facepalm Well now i feel like an idiot, it took ages for me to attempt to figure it out, and thats all it was? Idiot me....
Jun 23 '11 at 09:29 PM
GenericFantasy
(comments are locked)
|
|
The missing method is because Unity is case-sensitive, you call: when it should say: The second error is most likely that you've not wrapped up your prefab into a variable. Have a look at Instantiating Prefabs at Runtime in the docs. On lines 15-17, instead of doing this: you should do this: Where you first declare bubblePrefab and spawnPoint as variables outside the Update-function: Now it says The referenced script on this Behaviour is missing! UnityEngine.Object:Instantiate(Object, Vector3, Quaternion) MoveAround:Update() (at Assets/Scripts/MoveAround.js:17) And it wont let me assign the spawn point i created to the script. Its an empty gameobject just in front of the character
Jun 23 '11 at 09:57 PM
GenericFantasy
Make sure that the var spawnPoint is set as : Transform in the script (as provided in the example).
Jun 27 '11 at 09:59 AM
save
(comments are locked)
|
