1,352 questions
1
vote
0
answers
52
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 ...
-1
votes
1
answer
75
views
Need assistance with script which makes cube change color depending on the mouse state (up, down, over, etc.)
I'm trying to create a UnityScript. When the player hovers their mouse over a cube, it goes green. If the player does OnMouseDown, the color will go red. If the Player does OnMouseUp, the color will ...
0
votes
1
answer
78
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
313
views
MissingMethodException : UnityEngine.GameObject.setActive [closed]
I have added the below script to the NPC. on clicking on to the NPC the MessageBox (Panel in Canvas) should appear. But the MessageBox.setActive() part is not working. Below is the code.
import ...
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
95
views
Unity Javascript transform object not able to go in
var Distance;
var Target = transform;
var lookAtDistance = 25.0;
var attackRange = 15.0;
var moveSpeed = 5.0;
var Damping = 6.0;
function Update ()
{
Distance = Vector3.Distance(Target.position, ...
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
0
answers
42
views
Unity3D: How would I go by saving a list/ array of strings/ objects/ prefabs? [duplicate]
For my game in Unity 2017.2, I am trying to save the prefabs that I just bought in the games store (not IAP) and load them to a garage type scene.
I was first thinking I could get the name of the ...
0
votes
1
answer
804
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) ...
1
vote
2
answers
10k
views
How can I switch between shaders in real time?
The problem is that I have two shaders. If I change between the shaders while the game is running it will not take effect. Only if I start the game with a current shader it will use the shader but not ...
0
votes
1
answer
80
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") && ...
1
vote
3
answers
10k
views
unity - how two objects with rigidbody can pass through each other?
(I saw a question like mine, but my case is different)
I explain:
I have a 2d game(side view), where players going around and hit each other with weapons like sword or hammer. I set ground on a ...
0
votes
1
answer
72
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 ...
-1
votes
1
answer
2k
views
Unity3D input.acceleration
I want to move an object with acceleration input in unity:
if (...)
transform.translate(vector2.right*speed);
else if (...)
transform.translate(vector2.left*speed);
I don't know what the conditions ...
0
votes
1
answer
180
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....
1
vote
1
answer
223
views
Unity3d character move with arrows keys from point to point
I have a waypoints script that I apply to an object. For example, on a character that goes from point to point and stops for a certain time and then continues to walk. How can I modify the code if I ...
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 ...
0
votes
1
answer
77
views
Audio clip not playing Unityscript
I am trying to play an audio clip defined on a audio source component
but when I run the following code, nothing happens:
#pragma strict
var audioSource : AudioSource;
function Start () {
...
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 ?
0
votes
1
answer
170
views
Is it possible to control the 3D animation's movement in Unity script?
I have this golfer animation. It is quite smooth movement ant the best I can find in golfer animation.
But its movements are always the same pattern.
For example, if I like to use the model to ...
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 ...
13
votes
2
answers
21k
views
How to disable physics system in unity
I want to develop native android app in unity engine, and does not need to use physics, could it possible to disable physics engine for specific project in unity.
-2
votes
1
answer
616
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
2k
views
Rotate camera on z-axis using keyboard
I'm coming across a roadblock on something I thought would be a relatively simple problem. I want to "roll" the camera on the z-axis by pressing the "Q" and "E" keys.
Here is the code I've written, ...
0
votes
1
answer
101
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
1
answer
278
views
Unity3d + Vuforia Augmented Reality (AR) objects intersection
I am trying to make a game, where a kid has an image (of grass, for example) and a card (a monster). The monster should appear on the grass only if the kid puts card on it, and disappears on removing.
...
0
votes
2
answers
563
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
1
answer
3k
views
Is Unityscript/Javascript discontinued?
I am using Unity 2017.2.0b5. I tried to help somebody who asked a question about Unityscript few moments ago but I noticed that:
Assets > Create > C# Script is present but Assets > Create > ...
1
vote
2
answers
70
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
123
views
How to Configure Jenkins Login in iPad using Unity
I had installed Jenkins in network and making build successfully.
I want to have authentication for my iPad app, developed with unity. I searched the plugin respective to this, but i can't find it. ...
0
votes
1
answer
846
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 ...
1
vote
1
answer
1k
views
Unity DLL error when editing scripts
When I try to edit a script in Unity, I keep getting this error: "Unable to open UnityEngine.UI.dll: Check external applications preferences."
This also happens when I choose any other editor in the ...
0
votes
1
answer
442
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
755
views
Unity project changes not in executable
I have a unity project that I am building to an executable (windows x86).
I have built the project previously and have made some changes to the project again that shows up in the unity editor and all ...
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. ...
0
votes
1
answer
49
views
Change object on button down precisely at an object
I have a target object (cube), and a fake mouse that I created from an object (sphere) to be controlled by gamepad joystick. I want to bring out another object (let say; sphere), when I push the ...
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 ...
1
vote
2
answers
542
views
[Unity]How to draw a Ring Line in 3D
I'd like to draw the trajectory of an object that is moving circularly, but I do not know how to do it.
Could you tell me a good way?
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....
1
vote
0
answers
818
views
Error - Getting Unable to start AR tracking Please check that you have a camera connected error
I am not sure which repo is correct place to log this bug -
Hello,
I have just started development in AR / VR category and using ARToolkit with Unity. I created the most simple AR tracker with hiro.
...
-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:
...
32
votes
3
answers
64k
views
How to calculate sizeDelta in RectTransform?
I write a custom content fitter that is required for my custom layout. So, I need to control RectTransform.sizeDelta property when anchors aren't same but I can't get that shows this value.
I don't ...
0
votes
1
answer
233
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 ...
0
votes
1
answer
872
views
Unity Collider Button is not working on Android
I have a problem with a collider button: when I use the button on PC it works fine, but when I use it on mobile device the script is not working (but the collider should make a fade effect).
Video ...
-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 ) ...
1
vote
0
answers
60
views
How I can detect swipe on Unity3d [duplicate]
Look image for understend what I need
I found how to determine the touch on the top or bottom but I need more detail
I showed in the picture what I need.
Give a hint please
-3
votes
1
answer
66
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 ...
4
votes
2
answers
28k
views
how to access GameObject by instance id in Unity
In Unity, it provides a function to get the instance of GameObject
GetInstanceID ()
While the instance id could differ GameObjects, but the function to get GameObject by instance id
...
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 ...
0
votes
0
answers
78
views
Repeating Value Unity
It should give me a random value missing. It either gives me -.75 or .75 as missing however instead of any value from the list of outputs.
var Rando : float;
function Start () {
Amount = Random....