JavaScript taken from the web isn't working. Help
I copied some javascript to play an animation for attacking but it isn't working. Any help? Please? function Update() { if (Input.GetKeyDown("0")) { animation.Play("Knife_Attack_1"); } }
View ArticleHow can i make an animation like csgo case opening?
How can i make an animation like csgo case opening?
View ArticleUnityScript not recognizing NetworkServer "Unknown Identifier"
So I've been tinkering with this script now for multiple days and can't get it to work. My problem is that I've coded the rest of my scripts up until this point in Unity JavaScript, no C# at all, just...
View ArticleScriptingProblems - Open door with 3 keys
Hi, I have a problem with my scripting. I'm doing a labyrinth game where you have to find 3 keys to open the final door to win the game. I can collect the keys and it counts up in a guibox but I can't...
View ArticleReturn to the origin of rotation
Hi, I am trying to modify a script I found, This script is for rotate an object and works well, but I want to add the function of return to the origin of rotation after 2 seconds of inactivity. Please...
View ArticleHow do i make a character selection menu (2d game) ?
I recently made a 2d game. With an idea to make the game more interesting i thought of character selection. I had the player(object) as the name gamePlayer1 and the image i want to replace the sprite...
View ArticleHow to change a variable used in a loop for the outside ?
Hello, I've made a coroutine which applies a buff to a player. It works like this : **Applying Buff :** stoptime=Time.time+buffDuration; StartCoroutine("BuffAttack"); **Coroutine :** function...
View ArticleUnity3d 4.6 javascript prefab with script
Hi I created a prefab named block1 and added a script on them named sheepController which does following: var startingHealth:int = 2; var currentHealth:int; var isDead:boolean; function Awake () {...
View ArticleApplication.LoadLevel(""); - doesn't load my Scene
Hi, I want back to my menue when I lost my game, so when the time up. But timer disappears when the time is zero, so that works but it doesn't load my menue/scene. Can anyone help me please :) timer.js...
View ArticleHow to implement onTriggerEnter and onTriggerExit in Vuforia.
am working on Augmented reality game.can use character controller and Main Camera's player tag for colliders response.question is that how we can do the same thing by using AR Camera. Can we use...
View ArticleNeed help completely disabling a script
#pragma strict var talkLines:String[]; var talkTextGUI:UnityEngine.UI.Text; var textscrollSpeed:int; private var talking:boolean; private var textIsScrolling:boolean; private var...
View ArticleHelp with Unknown Identifier error 'Keycode'
i am trying to make a code where once i press Escape on my keyboard it switches the scene to my main menu i have set up but it keeps giving me this error Assets/Scripts/menuScript.js(3,21): BCE0005:...
View ArticleCustom Application.LoadLevel params
Hello, i would like to do somthing like this Scene1.js Application.LoadLevel("Scene2", "CustomString"); Scene2.js function Start () { var Param = GetLoadLvlParam(); }
View ArticleHow can I get my platforms to randomly appear when not activated by button
So I'm building a game and the first puzzle is a jumping puzzle. I have already created a button collision so that when the player enters the trigger the platforms will appear for 8 seconds. However,...
View ArticleI made the following script to position 256 gameobjects, but nothings...
#pragma strict function Awake () { var num : int = 1; for (var i : int = 1; i < 128; i ++) { var name = "DropPoint" + " (" + parseInt(num) + ")" ; var dropPoint = GameObject.Find(name); if (num <...
View ArticleMaking my variable global.
I was trying to change the sprite image of my character from another scene. I made two scripts 1. Sprite_Img.js 2. changeTheSprite.js I have attached Sprite_Img.js to my character object and...
View ArticleDestroying a projectile on collision
So, i'm try to make a projectile destroy itself once it collides with anything. I use this code but because of my character's own collider the projectile would instantly destroy itself: #pragma strict...
View ArticleHow can I limit rotate "missile gun" in global coordinates ? Java
var rotateSpeed = 120.0; function Update() { var rotateAmount = rotateSpeed * Time.deltaTime; if (Input.GetKey("up")) { transform.Rotate(-rotateAmount, 0, 0); } if (Input.GetKey("down")) {...
View Articlebullet destroy on collison
after adding in the 'Destroy(gameObject);' line to destroy the bullet after colliding with a wall for example the enemy will not shoot. Any ideas as to why? bullet script: var Dammage = 50; function...
View ArticleCannot see javascript files in Monodevelop Unity 5.2
Since upgrading to Unity 5.2 javascript files are not showing in the Monodevelop Solution explorer (see image below). Does anyone know how to resolve this issue?![alt text][1] [1]:...
View Article