Quantcast
Channel: Questions in topic: "error"
Browsing all 7934 articles
Browse latest View live

My code won't work and I can't fix it!

Here is my code: var Building : boolean; var Cost : int = 500; var Level : int = 1; var Factory : GameObject; function Start () { Building = false; Factory.active = false; } function Update () { }...

View Article


I keep getting error messgaes on the "Tags.cs" and the "PlayerLastSighted.cs"...

So I enter my code into MonoDevelop, and I get an error message that says Assets/Scripts/LastPlayerSighting.cs(23,63): error CS0117: `Tags' does not contain a definition for `alarmLight' This error...

View Article


cross product in cg shader - error "can't find __getVectorIndex"

Anyone know what this is about? This is my first real Unity shader (it's a port of a cg shader from a different project I'm moving to Unity). Here's the shader: Shader "Starboretum/Flora" { Properties...

View Article

Send an activity from C# to Java

Hi Everyone! I have a problem sending a variable of type Activity from C# to Java. The following source code is what I did in C#: public static string TestJava() { string somestring = ""; playerClass =...

View Article

Script not using other script #C

I have a script where on collision it set itself to false. This works fine, but when I try to tell it to call Emotes.Hearts(); from my Emote script I get this error: Assets/Scripts/Emotes.cs(11,21):...

View Article


Something wrong with my movement script...

Just a quick point-out: This script SHOULD have bools to move, I did not do it out of lack of programming experience. I did this so I can access the movement from other scripts whilst still having it...

View Article

Script para juntar objetos

Necesito ayuda con un script.. Quiero que me sumen las monedas que voy comiendo ("alimento"), para ello cree este script... pero no me suman las monedas!!! :( var salud = 100; private var Alimento = 0;...

View Article

Making a 2D Game, Flipping Textures ERROR

var X : float; function Start () {
//Gathering normal object scale x
X = transform.localScale.x;
} X = transform.localScale.x; } function Update () {
if(Input.GetKey(“a”)){ //Gamer pushes a key
//Set...

View Article


Instantiation Error

I am currently trying to instantiate a Prefab when the player collides with a GameObject. The code I have for this is: public var compass:GameObject; function OnTriggerEnter(collisionInfo:Collider){...

View Article


NullReferenceException: Object reference not set to an instance of an object...

Hi, I know this question has been asked a lot but I'm very very new to unity and don't really understand the answers. I get 2 errors "NullReferenceException: Object reference not set to an instance of...

View Article

...is inaccessible due to its protection level

Hey, I recently bought the "beginning 3D game development with unity" book (found on apress.com)and i downloaded the assets for the book, and every script has this error "...is inaccessible due to its...

View Article

NullReferenceException - Why?

Hello everybody, I'm a beginner in scripting, but I tried to make a script that allows me to have a flashlight with limited power, an on and off switch and a GUI Label that shows the enery that is...

View Article

I'm getting an ERROR with a Moving Camera I'm trying to use.

Sooo... Error: Assets/Scripts/FollowCamera.js(12,62): BCE0044: unexpected char: 0x2013. My JS: var target : Transform; var distance = 10; var height = 0; var damping = 5.0; var smoothRotation = false;...

View Article


need help with simple c# movement script

Hi, I don't understand what's wrong with this script, this has happened with several scripts I've tried. Basically it's all in red, most of the errors are from functions apparently not being in the...

View Article

error CS1612: Cannot modify a value type return value of...

i need some help modify some c# code ive got everything else down i just need this little part to fix (hopefully) any help? everything ive seen doesnt explain really how to fix the problem. using...

View Article


Varied footsteps - Object reference not set to an instance of an object?

Hello! My aim is to have different footstep sounds depending on the ground the player is walking on. The over all structure is this: variable to determine if the player is walking, raycast down if...

View Article

UnityEngine could not be found?

Thanks for looking at my question. I am trying to code my game in MonoDevelop(C#), but I could never compile correctly because, next to the line, using UnityEngine; The error said, using UnityEngine;...

View Article


Code Problem

PLS Help Me I get these 4 errors : UnityException: You are not allowed to call this function when declaring a variable. Move it to the line after without a variable declaration. If you are using C#...

View Article

If gameobject moves do this

I am trying to have one gameobject set active upon another gameobject moving beyond its current position in the y axis. Please help if you can. Getting a "Missing Field Exception:...

View Article

Error in script

Here are my scripts (I copied them from here - http://answers.unity3d.com/questions/606915/how-to-move-rigidbody2d-on-touch--1.html I attached this to my Player object and named the script Player.cs :...

View Article
Browsing all 7934 articles
Browse latest View live