How To Make An Object Stay Somewhere Relative To Another Object
This may have already been discussed, but here we go anyway. I have this code right here: #pragma strict public var target : Transform; function Update () { transform.rotation.x = target.rotation.x;...
View ArticleHow to parent the state of a component with another one
Hi everyone, how can I parent a component check box to another one in the same game object? When the parent *(a mesh renderer)* turns on *(due to trackable AR found)*, the child would turn on *(it's a...
View ArticleNullReferenceException Guys I cant find the where is the mistake
public var stars: int[]; This is my first code in the CardDatabase gameobject. And i gave the variables in inspector. This is another code with name carddatabase: var database : GameObject; var i :...
View ArticleHelp writing to a file every update/frame (JS)
Hello all, Here is my code, I wish to save and overwrite an integer variable every frame to a file. (JS) import System; import System.IO; var targetScript: Dupe; var fileName = "MyFile.txt"; function...
View Articleserialization (save and load game) on a javascript based project, should...
basically i have a javascript based project and im trying to find a serialization script for saving and loading, the only scripts i can find are c#, can i use c# script with lots of javascript, and...
View Articlei'm beginner in unity ! my problem is i can't count the number of zombie...
#pragma strict var ZombieHealth : int = 100 ; function OnCollisionEnter (col : Collision) { if ( col.gameObject.tag == "Bullet") { ZombieHealth -= 25 ; } } function Update () { if ( ZombieHealth <=...
View Articlehow to modify another objects kinematic state?
I am making a game where a ball falls into a trigger and then the ball freezes by setting it's kinematic state to true. #pragma strict var ball: Rigidbody; function Start () { } function Update () { }...
View ArticleBCE0044: expecting ''', found '\r'.
The full error is Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/Disparo.js(29,52): BCE0044: expecting ''', found '\r'. Here's my script. Any help? var Tiempo = 0; var TiempoMaximo = 3;...
View ArticleVariable won't appear on UI text (JS)
Hi all, I'm in a bit of a pickle with my code. There are no errors thrown up with it but long story short my code won't put a variable in the UI text: import System; import System.IO; import...
View ArticleObject reference not set to an instance of an object help (JS)
Hi all, Here is my code that checks to see a if a int variable is between different ranges by using if statments. There's probably a more elgant way of doing this but the error I am getting is an...
View ArticleWhy UI layer is being ignored by the raycast?
In my scene the character moves to the mouse position on left mouse click if we have clicked on the ground. I use raycast to determine if we clicked on a object on which we can move. I have all objects...
View ArticleHow to change jump height depending on your health
I'm using Javascripts, but my FPSController is the default prefab made with C#, so I don't really know if I can directly link JS with C#. That aside, you begin with 100 Health, I've made a way to gain...
View ArticleBCE0044: expecting }, found ''.
The full error is Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/Disparo.js(40,1): BCE0044: expecting }, found ''. Here's my script. Any help? var Tiempo = 0; var TiempoMaximo = 3; var...
View ArticleProblem with disabling mouselook script
I want to make a script that disables the character controller's mouselook script when the player enters a trigger, but when I enter the trigger it gives this error: Object reference not set to an...
View ArticleUnity - JavaScript, it takes screen shot but doesn't post(form) to server. it...
The javascript code is as followes... #pragma strict var screenShotURL= "http://localhost/upload_file.php"; function Start(){ //print(Application.srcPath); } function Update () { //Upload(); } function...
View ArticleJavaScript function OnGUI error
I have 2 errors in console after write simple CaptureControll JavaScript. If you know where is mistake please help me! 1. error: Assets/CaptureControll.js(67,26): BCE0044: expecting (, found 'OnGUI'....
View ArticleBCE0044: expecting }, found ''.
The full error is Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/Disparo.js(40,1): BCE0044: expecting }, found ''. Here's my script. Any help? var Tiempo = 0; var TiempoMaximo = 3; var...
View ArticleInsert a string to a list inside a list
**I want to set the string of an index from a list that's inside a list** So I got a variable like this: var everyRow = new List.< List.>(); My attempt at accessesing the inner List is by:...
View ArticleI'm causing the following error while making a javascript in unity so the...
The code is: 1 var target : Transform 2 3 function Update () { 4 } 5 6 function OnMouseDown () { 7 this.transform.position = target.position; 8 this.transform.parent =...
View Article