Having a OnTriggerEnter make another gameobject Add Force in UnityScript.
Using javascript, I was experimenting with OnTrigger functions with a trigger game object, I thought about triggering another gameobject to add force. Problem is, I don't understand how it would work...
View ArticleTriggering animations in set areas by Key Press?
Hey all, I'm pretty new to Unity and am in the middle of trying to figure this out. I have a chest that I want to open by pressing the "E" key, but I only want this to work when I am right up against...
View Articlehow to enable a java script inside a gameobject on press of the space key?
hey, I'm trying to make a racing game and I would like it to start still until the space key is pressed .thanks NITRO.P ![alt text][1] (I'm using the latest unity 5.3.4 ) [1]:...
View ArticleExpecting }, found 'static'
Also: expecting EOF, found '}'. #pragma strict var rotationSpeed = 100; function Update () { var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed; rotation *= Time.deltaTime; static...
View ArticleWebGL: Syntax error for unrecognized expression from UnityLoader.js when...
I have a handful of WebGL projects hosted on a GoDaddy Windows (Plesk) server. Each one throws a JavaScript error when I click on a link within the page, but outside of the canvas element. For example,...
View ArticleHow to check if game object intersected a drawn rectangle
Currently im trying to check if my ball is intersecting my drawn rect. I know I need to convert from world to gui points but I have no idea how to do this. Can someone help? im using javascript.
View ArticleBCE0043 unexpected token: ")"?
Im new to coding, and I got error Assets/Scripts/cannon shoot.js(10,64): BCE0043: Unexpected token: )., I know that means im not using ")" right, but I can't figure out whats wrong with my code. I...
View ArticleCant switch between legacy animations
I have 2 animations for an FPS arm/gun. One for hipfire and one for aiming down sights. The problem is it only plays the hipfire animation even when aiming down sights. I'm using a simple javascript in...
View ArticleCan't Switch Between Legacy Animations
I have 2 animations for an FPS arm/gun. One for hipfire and one for aiming down sights. The problem is it only plays the hipfire animation even when aiming down sights. I'm using a simple javascript in...
View ArticleTeleport to next scene on trigger
I was wondering if there is a script I can use that can be usable across many scenes without having to go and change the integer of the scene every time I want to progress in levels.
View ArticleStatic Array JS
I am trying to make a static array that holds an integer in each element, however upon testing, the array seems to be new for each object that accesses it. This is attached to an object, that...
View ArticleCannot Convert boolean to UnityEngine.GameObject
Hey guys, Im trying to switch views in game from the Main Camera to the 1st Person Controller, I have it set up so that the Main Camera is Enabled at the start and the 1st Person is Disabled, But I Get...
View ArticlePick-Up Object With Mouse Hold
I am trying to make my game so that you can look at an object, and if close enough, pick it up by holding mouse down. I have created an empty object and placed it where I want the held object to be. I...
View ArticleBasketball Score counter
I'm Making A basketball game, And My Scripts Aren't Working! Please Help, Its Not Counting The Points. PS: I'm New To Scripting #pragma strict static var Score : int = 0; function OnGUI () { GUI.Box...
View ArticleJavaScript : OnCollisionEnter not working
I want to when my bullet collides with the enemy both get destroyed, but i can't get it to work. Also tried to remove tags and it still doesn't work. **Bullet Script** #pragma strict var...
View ArticleHi! I need a JavaScript that allows me to go to the next level after I have...
I am working on a 2D game where I need to finish collecting items to go onto the next level. The player would need to collect 40 pickup items for the game to move to next level. It would be really...
View ArticleHow to increase the sensitivity of the touch on the phone In a Pong Game?
Hi! I am making a Pong Game. I am nearly done with it. I just had one issue - my player only moves when I touch the part of the screen where the Player Paddle is located. I want to make it so that...
View ArticleDrag and drop GUI elements with JS?
Hi all, I'm trying to set up a system where the player has to drag and drop (or correctly select the order) of a few different GUI elements into place. How would I go about doing this? Looking for JS...
View ArticleSet Active Random GameObject from array (JavaScript)
I have an array of GameObjects. When the game starts, I want a script that will randomly choose one of the objects in the array and set it as active. This need to be in JavaScript.
View ArticleWriting save files (JavaScript)
For a while now I have been trying to make a save function for my game. I want to make a script that saves data into a text file so can loaded when you re-open the game. My idea was saving data such as...
View Article