Component added at runtime throws null reference
The prefab tagged "Player" has the ShipWeapons() script added to it through the editor. The Vitals() script is added to the object when it is instantiated. Attempting to GetComponent the runtime-added...
View Article[Help] FormatException: Input string was not in the correct format...
In Spanish: Hola , tengo un problema en unity , estoy intentando de diseñar un sistema de cuando se llegue a una cierta puntuación en un GUIText , se termine el juego : In English: Hi, I have a problem...
View ArticleErrors asking for Semicolons in strange places
When I put the line of code var Sprite[] sprites = Resources.LoadAll("SpriteSheet"); in my start function, it throws the error: Assets/Contoller.js(40,21): UCE0001: ';' expected. Insert a semicolon at...
View ArticleBCE 0044 expecting ), found '=='. Help
I have no idea what to do to fix this error. Please Help. function Countdown() { if( --gameTime == 0 ) { CancelInvoke( "Countdown" ); **if( Score == <5 && gameTime == 0 )** {...
View ArticleTerrain Modification Script index out of range?
I am making a script to make my terrain blocky like in minecraft but since I am new to unity3d's terrain class it is proving a challenge, I do not know why but I get a IndexOutOfRangeError on line 23....
View ArticleTags not working?
I'm having some problems with the tags at the unity, they are not working i think. What i want is that when the character collides with the ammo, the ammo object is destroyed, and then the character...
View ArticleScript Chat Error.
Well I found this script here on my computer and decided to use it but it has a bug that does not know what it is, does anyone could help? Script: using UnityEngine; using System.Collections; public...
View ArticleiTween + IEnumerator: InvalidCastException: Cannot cast from source type to...
I get the Error "InvalidCastException: Cannot cast from source type to destination type.", when I tried to use this script: void OnTriggerEnter(Collider other) { ... direction = new Vector3(1, 0, 0);...
View ArticleError message with melee script
#pragma strict var TheDamage : int = 50; var Distance : float; function update () { if (Input.GetButtonDown("Fire1")) { var Hit : RaycastHit; if (Physics.Raycast (Transform.position,...
View ArticleInfinite runner world creation
Hey people,can someone help me on scripting this.I'm doing this like subway surfer,keeping player stationary and moving the world around him.My question is how can i instantiate the track prefab...
View ArticleTower defense LevelMaster script error
Hi guys i'm making a tower deffense game and i have one problem with my script: #pragma strict static var playerDamage = 0; //states var waveActive : boolean = false; var spawnEnemies : boolean =...
View ArticleArgument out of range on a List?
Hi! I'm getting an error that I don't understand. Here's the code... private List _activeNotifsList; ... void Start () { _activeNotifsList = new List(); } ... public void LerpNotifButtons(){ //If an...
View ArticleWhy I couldn't download free assets?
Hi, I am new to unity. I logged in and tried to download the space shooter assets but the browser said it couldn't open the website. What should I do?! [1]: /storage/temp/22071-download_error.png
View Articleproblems with iAD banner
as it says im having problems putting a simple iAD banner at the bottom of my screen, for some reason i get errors in the code a lot of them even when i use the standard unity doc code, any help...
View ArticleCollecting 2 items at a time by mistake.
I have a very simple game where the goal is to collect 15 stars. Everything works fine except that some of the stars count for 2 points instead of 1. I tried deleting the stars that get counted twice,...
View ArticleNot all code paths return a value?
I'm getting an error in Unity that I've never gotten before. It says: *Assets/Scripts/Managers/PlayerFunds.cs(20,22): error CS0161: `PlayerFunds.SaveCredits()': not all code paths return a value* The...
View ArticleCS8025 Parsing Error
I'm getting CS8025 Parsing Error in line (39,9)> using UnityEngine; using> System.Collections;>> public class PlayerBehaviour :> MonoBehaviour {>> public Transform mesh; public...
View ArticleFix this script?
I saw this script and I tried it out but it doesnt work because of the following error Assets/Scripts/Hunger.js(26,25): BCE0044: unexpected char: 0x200B. Could someone perhaps fix it. var Health : int...
View ArticleTrying to create a new script in javascript error
every time i try to add a new component and i add the script i press add and a null error comes up and i don't know how to fix this can anyone help me. This is the error message that comes up:...
View ArticleThe name `DebugUtils' does not exist in the current context
Hello Everyone. [I just downloaded this tool ][1]called "C# version extended with break time by by Francesco Montors" As soon as i imported it onto my game i got the following error,...
View Article