External Javascript call in Unity WebGL
Hi, I have a project where I need to be able to communicate with a Unity WebGL application from the page it is located in. For example, If I click a button "View Model," the unity should load the...
View ArticleDid something change in Unity 5 that makes this not work?
I'm having a problem trying to get a game object to move to the location of my mouse pointer when I click. I used the script located at http://docs.unity3d.com/Manual/nav-MoveToClickPoint.html I'm...
View Articleclamping player position while in cover
So, I'm trying to integrate a cover system, and so far i have it to the point where the player can lerp to the object, and walk along it's surface. But, I'm running into issues right now, because if...
View ArticleHow do I reference a UI text in Unity 5? (JS)
Hi, I was using gui texture before upgrading to Unity 5 however they no longer work (and were pretty crappy anyway). I'm not sure what the correct variable type the UI texture is in javascript ("Text"...
View ArticleNullReferenceException:Object reference not set to an instance of an object
I create a menu of game script: var quit=false; function OnMouseEnter() { GetComponent.renderer.material.color = Color.red; //Change Color to red! } function OnMouseExit() {...
View ArticleTried to set animation speed: Type 'UnityEngine.Component' does not support...
When I try to set an animation speed I get this error: Type 'UnityEngine.Component' does not support slicing. This is the code I have: var WalkSpeedModifier : float = 8; var WalkAnim : String = "Walk";...
View ArticleWhy isn't my animation being played?
The animation works fine with my C# code, but it doesn't play when I try to trigger it from the JS code. JS Code (where the animations doesn't play): #pragma strict var speed : float = 10.0; internal...
View ArticleA way to instantiate an item with 90 Degree increments?
I am working on a very complex simulation game, I have code most of it myself, However for things you spawn in such as torches, and unsymmetrical items, I need a way that I can instantiate the prefab...
View ArticleHow to tile camera want the player move left and right?
Hello, My name is khairul i'm 13 years old, i'm still new in scripting, But i know a little bit about scripts, i Know JavaScript a bit. But i want, Went the player move the camera left and right the...
View ArticleGet Component Errors
In my scripts I'm trying to locate two other components and disable them from an inventory system. My Script: private var showGUI : boolean = false; function Update() { if (Input.GetKeyDown ("i")) {...
View ArticleWhat does this error mean and how do I resolve it?
I have a program that should add vertical force to a rigid body when the space key is pressed but I keep getting the same error that says "An item with the same key has already been added". I can't...
View ArticleSemiColon At The End,Expecting Found /N? Help!
I got 2 errors that says expected insert a semicolon at the end and expecting found /n. Help Please! #pragma strict var TheDamage : int 50; var Distance : float; Function Uptade () ' { if...
View ArticleHow to get the next file in a directory?
I have a directory of files, with one of them currently in use by the scene. I have an array of all the files in the directory (using DirectoryInfo.GetFiles) and the name of the current file. I'm...
View ArticleVariable Not Changing.
Hi all, I've bumped in to another problem. So I have a variable here: private var currentNode : GameObject; And I have two functions: function MarkingCurrentAsClosed() { var nodeInfo : NodeInfo =...
View ArticleSemiColon At The End and Found /n Errors! Help!
#pragma strict var TheDamage : int 50; var Distance : float; Function Uptade () ' { if (Input.GetMouseButtonDown("Fire1")) { var hit : RaycastHit; if (Physics.Raycast Transform.position,...
View Articlejavascript drops over 30 fps
Is here something to do with this script. It lags very much and drops over 30 frames. It is day and night script what calculates time, moves sun etc. #pragma strict public var Sun : Light; var stars :...
View ArticleDisable Mouse Look Script Not Working!
I can't find a way to disable the mouse look script when I open a menu. My screen cursor is locked then unlocked when you open the menu. Code Menu 1 ( Only the parts of the script you need to see ;) )...
View ArticleScript Fix Help plz !
Hi i downloaded a 3d model of a city and i have this error : Assets/PostApo/_origin/Standard Assets/Character Controllers/Sources/Scripts/ThirdPersonCamera.js(31,26): BCE0018: The name...
View ArticleWaitForSeconds not working in js
It is supposed to wait a second before doing the next step but it just does it all at once. function clickedgo () { for(var i=0;i
View ArticleProblems with writing to a file
Hi, I am using JavaScript in order to write some game statuses to a text file. But for some reason, I can't write to them. My code goes something like: import System.IO; import System; Var filename :...
View Article