Setting materials at runtime
Hey, I'm trying to change the material of a group of objects at runtime, and I'm coming across a rather strange issue. I have a method which gets me a list of the Transforms of all the objects I need...
View ArticleHaving problems destroying an Object
OK, so Im trying to destroy an object and cant seem to work out why its not happening. Basically Im at a terminal and want to switch a fence from activated to deactivated. Simply I want to destroy one...
View ArticleThe name 'Flashlight' doesn't exist in the current context
I'm using Visual Studio 2010 Pro to write some script for a horror game that I am making, but when I try to enter the word "Flashlight" in Flashlight.BatteryLife, Flashlight is underlined in red saying...
View ArticleVery low FPS, only build shows problems?
In the editor the game will run at a very high FPS with no apparent issues or error codes. The problem occurs when I try to build the game and run it as a stand alone, it slows to a couple frames per...
View ArticleGameObject.active is obsolete
I'm trying to add GameObject.SetActiveRecursively and .active to my PickUp script, but I can't use them at all. In place of those two are .SetActive() which is fine, but I need .active or something...
View Articleinherits error of camera while calling in script.
I am instantiating obtecs tin for loop. Using AddComponenti am attaching a script I declared private Camera camera; In start function i given camera = GameObject.Find("Main Camera").GetComponent(); I...
View ArticleMongoDB problem
I add reference MongoDB.Bson.dll and MongoDB.Driver.dll but MongoDB.Driver.dll have reference to MongoDB.Bson and this reference can't load code: public class Entity { public ObjectId Id { get; set; }...
View Articletransform.parent can't go with gameObject.find
I'm trying to create a script where function update finds the main camera, then childs the current object to it (The object the contains this script), but I've run into a problem. If I change...
View ArticleProblem with Input.touchCount == 1
Howdy Everyone! I have an orthographic camera facing z negative at positive z = 20. I want the player to pan the camera with one finger and zoom the camera when they pinch. So far I have the pinch...
View ArticleMultiplayer Script ERROR WTF
Hello... Today... i was scripting so hard ( Following a tutorial because im a noob D:) and well.. i founded a problem.. also here is the tutorial: http://www.youtube.com/watch?v=uFjW2QL1TeM Well.. the...
View Article"JNI: Unable to find field id..." and Android Segmentation Fault (Signal 11)
Please help me, I've been stucked in this problem since friday. (And sorry for my bad english) I've got a project split-builded in an .apk and .obb parts, using the Google Play Services SDK. The first...
View ArticleAssets missing in android export.
So i'm developing a game for android on the unity indie version and i built and ran a couple of builds on my samsung galaxy s2 and they ran fine. but all of the sudden every build i do for the android...
View ArticleNullReferenceException: Object reference not set to an instance of an object...
var levelToLoad : String; var beep : AudioClip; var QuitButton : boolean = true; function OnMouseEnter() { audio.PlayOneShot(beep); renderer.material.color = Color.green; } function OnMouseExit() {...
View ArticleUnhandled Exception: System.TypeLoadException: Could not load type...
Hi everyone! Yesterday Unity crashed during a playtest. Now I'm getting this error: Internal compiler error. See the console log for more information. output was: Unhandled Exception:...
View ArticleScript not working, help please
So this is kinda the continuation of this thread: http://answers.unity3d.com/questions/495573/use-of-unassigned-variable-script-from-script-refe.html which I already got help and the error disappeared...
View ArticleExpressions in statements must only be executed for their side-effects.
Hey everyone. So I was writing this really long script(some parts copied other self written) to make a tank move with the correct physics and such, when I came across the error above. I know that the...
View ArticleWhat is the difference between "as" and (typecast)
Hey guys, I was wondering why I would get an error with the following code (specifically the last line): string[] races = Enum.GetValues(typeof(Race)) as string[]; string randomRace =...
View ArticlePause script errror.
I get this error: Assets/My Scripts/Pauser.js(3,18): BCE0044: expecting (, found 'Pause'. function Start() { function Pause(); } function Pause() { while (true) { if (Input.GetKeyDown(KeyCode.P)) { if...
View ArticleExpression denotes a `method group', where a `variable', `value' or `type'...
Hi, so I started working on the AI attack function, I am having some problems tho, in the last line of this part of my script: void Attack () { RaycastHit hit; if (Physics.Raycast(transform.position,...
View ArticleNullReference from External Script
Hi all, I've been trying every solution I can find for this but not sure whats going on. I have a script attached to a chest collider trigger that detects the person entering the collider. That script...
View Article