1,352 questions
1
vote
0
answers
39
views
How to check for possible collisions using gizmos
I am making a clone of the game "Arrow Out." I am not sure if this is even the correct way but I am thinking of using gizmos to check if there is another arrow in the path of the clicked ...
0
votes
1
answer
76
views
What is the correct syntax to use LINQ SUM in UnityScript
Hello I'm trying to figure out the correct syntax for getting the sum from a class list using LINQ in unityscript
var totalCount: int;
class munsters {
var beast: String;
var min: int = 1;
var max:...
2
votes
1
answer
2k
views
Why is it SO Hard to Just Mute a Sound in Unity?
I have spent all day looking for a solution to this problem, and I simply can't find one. Using JavaScript in Unity 3D, I have a script where I want to play a sound when the player's velocity on the X ...
0
votes
1
answer
1k
views
Unity How to turn off a gameObject's Mesh Collider when a collison on another object is done?
On my unity project I have encountered a problem I want to collide with an object then I want to turn on the mesh collider of an other gameObject this is my code now...
#pragma strict
private var ...
0
votes
1
answer
800
views
Teleporting Character From Edge to Edge of the Screen
I am trying to Teleport a character from a Edge of the screen to the contrary edge I'm using this:
var pos: Vector3 = Camera.main.WorldToViewportPoint(transform.position);
if (pos.x < 0.0) ...
0
votes
1
answer
78
views
GameObject activates too soon
EDIT
So it's in here, of this I have no doubt, but why? NextOne.active = true; is firing off regardless of whether the action button is being pressed.
if(Input.GetButtonDown("Action") && ...
0
votes
1
answer
69
views
class extend variable scope in unityscript
Let me be more specific here: This is used in Unity 2017 so the syntax they are using is this:
class CameraMotionBlurEditor extends Editor
{
var preview : SerializedProperty;
var ...
0
votes
1
answer
176
views
Assets/shadow.js(9,19): BCE0019: 'active' is not a member of 'UnityEngine.Transform'
#pragma strict
var target : Transform;
function Start () {
}
function Update () {
if(target.active){
gameObject.transform.position.x= target.transform.position.x;
gameObject....
3
votes
1
answer
1k
views
Unity js script not working
I have recently taken an interest into unity, and as I guide a chose a playlist from youtube. I have installed the
Unity 5.6.4
16 Oct, 2017
version as well.
Now, I encounter an error when I try to ...
6
votes
1
answer
9k
views
Can I use Java script language in Unity3d 2017.2?
I notice that in MonoDevelop editor the auto correction for javascript it doesn't work .
Does this mean that Unity is willing to abandon JS ?
Can I use Java script language in Unity 2017.2 ?
1
vote
1
answer
1k
views
Unity -- Camera Child of Player Rotates Uncontrollably
I have a camera that I want to stay at all times at the same position as the player. I did this by making it a child of the player, since when I did it through a script the player got ahead of the ...
-2
votes
1
answer
607
views
Multithreading in Unity on Android
Some "long work" needs to be performed during game process. Obviously game freezes on 1-2 seconds when this work is being performed. So i put algorithm of "long work" to second thread and, as was ...
0
votes
1
answer
99
views
Read mouse click Input.GetMouseDown with Unityscript
I try to get on the mouse down work, I have find a example but its not work
this is my error
Assets/scripts/onclickx.js(13,5): BCE0044: expecting EOF, found '}'.
This is my code
import UnityEngine....
0
votes
2
answers
559
views
Unity NullReferenceException after accessing a variable of another script
after trying to acces a variable in another Script of another GameObject out of a List, I get every time an Exception. The Main code looks like this:
private var BombList = new List.<GameObject>...
1
vote
2
answers
66
views
How to randomize data in unity using JavaScript
I have a text file in project with some text data. Using below code I'm showing my data one line at a time when player click on a button (called NEXT).
For some reason what I want to do is make a ...
0
votes
1
answer
840
views
UnityEngine.VR.WSA.WebCam Not Found During Build
I tried to use Unity VideoCapture API, which is located inside UnityEngine.VR.WSA.WebCam namespace. In Editor mode I can play the scene without getting any error, but when I tried to build it for ...
0
votes
1
answer
439
views
how can i make a callback function on Unity JS
I've decided to make a game with Unity + Node.js, and I'm trying to use a socket.io library with unityscript
Here is my code so far:
#pragma strict
import System.Collections.Generic;
import ...
0
votes
1
answer
3k
views
Finding Currently Selected Button [duplicate]
I have been trying to find an aswer to this for hours. I am trying to get the button GameObject that accessed a function on one of my scripts. I just need to know which button accessed the script. ...
2
votes
1
answer
5k
views
Unity 2017.10f3 .Net 4.6 target issue
I've updated the player settings API to be 4.6 as documented.
But my project is still targeting 3.5.
I also tried to manually update the csproj to 4.6
But after unity was opened it overrided it again ...
0
votes
1
answer
1k
views
Unity: (js) Loading PNGs in assets folder to UI Image
In my Unity project, under a canvas, I created a blank UI Image.
On the other hand, in the assets folder, I have multiple PNGs.
I want the UI Image to be set as a random PNG from the folder via script....
-2
votes
1
answer
132
views
Starting a game - Tetris infinite runner?
Having trouble describing what I'm looking for - essentially, I'm classed as a beginner at unity, I've only made artwork for games, never created the core myself.
Preface: Here's game in a nutshell:
...
0
votes
1
answer
230
views
How to update APK without send the whole file again
Here's the problem, I have a unity-Android Game and every time I have to upload the update the only way I find send the update is by sending the whole APK again and this sucks because users have to ...
-1
votes
2
answers
5k
views
How to Switch Between two Animations in Unity
i have a horse with two animations ( run and walk ) in my scene
normally the horse is walking using (walk) animation
i need When the player approaches from the horse, the horse escapes using (run ) ...
-3
votes
1
answer
65
views
Unable to change source image on button click event?
var a;
var b:Sprite;
function Start () {
a=GetComponent.<UI.Image>();
}
function Clicked(){
a.SourceImage=b;
}
The function clicked is called on a OnClick event.
The error I ...
1
vote
0
answers
79
views
Flashlight not turning on when entering trigger zone
I have a trigger zone that when the players enter the flashlight goes off. This part works. However when the player enters the second trigger zone the flashlight does not turn on again. Not sure ...