Quantcast
Channel: Questions in topic: "javascipt"
Browsing all 1875 articles
Browse latest View live
↧

enemy looking randomly?

Is there a Javascript code that I can use So once it gets to a certain point in the code(Planned ahead and entered already) then he will look one dirction stop looking that direction then look a...

View Article


Monodevelop freezes opening js files after creating new project

When I create a new project Monodevelop can no longer open js files (freeze shortly after startup). It opens them in older projects and it can also open c# files just fine. I tried updating Microsoft...

View Article


Invalid IL code error when calling static function

I'm making a game where the player can fly via static var jumpHeight = 8; static function fly (){ GetComponent.().velocity.y = jumpHeight; } which is being called by if (Input.GetKey (KeyCode.Space)) {...

View Article

Can I use an array to determine an enclosed area and remove objects inside?

I'll be honest, I have very little experience with Arrays and I am only starting to understand them. I just want to know a basic idea as to how this would work and get a good insight as to how this...

View Article

Access gameobject from a different scene...

Hey, Im a beginner at unity, so sorry if there is a very simple answer to this XD I have two scenes so far in my game, my main scene and main menu scene, In my main menu scene I have created a...

View Article


';' expected. Add semicolon at the end.

Where is a semicolon needed in this code? if(currenthealth <= 0) { dead=true; } if(dead) { AI=(AI)Component.GetComponent("AI"); } if(ai) { ai.dead=true; currenthealth = 0; }

View Article

Change Object's Position OnTrigger

I made a script to change a gameobject when in a trigger collider and when I pressed "e". I had an earlier script that changed its position but it was not on trigger but just when I pressed "e". Here's...

View Article

Health Will Not Deplete as I shoot Enemy.

I do not know what is wrong. No console errors. Just everytime I shoot my enemy with raycast the health will not go down. Here is my code: using UnityEngine; using System.Collections; public class...

View Article


InputField in a different scene to Text

Hey, sorry if there is a simple answer to my question, I'm a beginner in unity XD Im using 5.3. I have an InputField in my main menu scene, and in another scene I have a text gameobject which displays...

View Article


Screenshot to variable

When I call the 'TakeScreenshot' function i want it to take a screenshot and place it into a variable. I was looking at `Application.CaptureScreenshot ()` but could not get it to work. Any help would...

View Article

Why is this String.Split() giving a object reference not set error?

this is giving a Null reference exception: object reference not set to an instance of an object but i cant figure out why, the error is near the end where it declares variable line2 as an array of...

View Article

Network Manager Script Error BCE0018: The name 'NetworkManager' does not...

Hi, im working on a 2D multiplayer game in UnityScript. I started trying to use the Network Manager but on all the tutorials i found it showed adding a Network Manager component in the network tab, but...

View Article

Serialize, Save and Load using Javascript

Hi, i'm sorry if i'm asking something that's probably already been answered before, but i did my research & i can't find anything regardless of how to serialize, save & load using javascript,...

View Article


Unity Fog Script for a Certain level

I am making water for my level and I was hoping anyone had a script that when the Camera went under, say, 47.7 on the Y axis, it would change to a thick blue-sh fog to simulate that you are underwater,...

View Article

speed = transform.rotation * speed; explanation please?

So I was watching this guy on youtube.. He used the code "speed = transform.rotation * speed" to align the rotation of the player object and the camera. You know, so wherever your pointing your camera,...

View Article


Help me to finish my enemy ai script i just want to make a enemy patrolling...

var Player : Transform; var MoveSpeed = 4; var MaxDist = 10; var MinDist = 5; function Start () { } function Update () { transform.LookAt(Player);...

View Article

GUI.Window only shows for one frame under all circumstances

Okay, this is really starting to annoy me as I've tried to fix it for over a week now and the internet doesn't help at all because people keep asking this question saying that they put the window call...

View Article


Sending the C# function parameter to JS function.

I'm trying to implement kinect to one of my games. Already got the function which listens to kinect gestures and recognises them well. Function is written in C#. It basically set boolean function to...

View Article

System.IO sharing error despite closing the read and write

system.io is giving a sharing file error when using these two functions (not simultaneously) here are the two functions that handle saving and loading from what i can tell it looks to be something to...

View Article

Help Add time when collecting objects js

Hello everyone. I have a script here which allows me to collect objects and a timer script that when reaches zero moves to a certain scene. But I really need help in adding atleast 5 seconds to every...

View Article
Browsing all 1875 articles
Browse latest View live