Unityscript is one of the scripting languages available for the Unity engine (other languages are C# and Boo).

learn more… | top users | synonyms

0
votes
1answer
23 views

Can 2D Rigidbodies detect collisions with 3D Box colliders?

I would like to know if Rigidbody2D's can detect collisions with 3D Box colliders and/or normal rigidbodies. I seem to have a problem where my 2D Colliders don't detect collision with my 3D Cubes. ...
0
votes
1answer
24 views

Align UI element to gameObject in 2D

I have a 2d game where I want to display UI element perfectly aligned to specific gameObjects. I have an ortographic camera and I used to Camera.main.WorldToScreenPoint() function giving it the ...
0
votes
0answers
16 views

Unity – Recording data for a behavioral experiment?

I am conducting a study using Unity and Oculus Rift and I need to collect the data from my subject. My participant is moving in a 3D maze created in Unity and using the Oculus. At any given time, I ...
0
votes
0answers
22 views

Add script to created gameobject via script

GameObject.AddComponent Hi, I have this c# code. It is creating random cubes and spheres. I have a script named "destroy". I want to add this "destroy" script to below code. I gave new material but ...
1
vote
1answer
56 views

How do I snap the Unity camera to a 2D, tile-based map?

I have a 2D, tile-based map. I want to be able to control the number of visible tiles on the screen vertically and horizontally, regardless of resolution. I want the player to be able to move the ...
1
vote
1answer
29 views

Unable to move mouse cursor while pressing keyboard button

I've a player to which I've attached character controller and two scripts - Controller and MouseLooker to control the player movements but when I try to move my mouse cursor while pressing keyboard ...
0
votes
0answers
17 views

Conversion from .dae to XML for 3D Models in Unity BuildR

My partner and I are trying to import .dae files from Sketchup as well as 3DS Max into Unity's BuildR extension. Collada a.k.a. .dae files have an XML-based schema so we incorrectly assumed they would ...
0
votes
1answer
39 views

How does Color.Lerp works?

I want to understand how does Color.Lerp works in unity. According to this page it is quite clear to understand how to use it but I'm interested in how it is implemented. Does it work on RGB channels? ...
1
vote
1answer
59 views

Why transform.find() does not need actual object[unity]

I m new to unity and C#. I suspect that transform.find() function below does not need actual object reference like player.transform.find() because it transform find is already applied to the ...
0
votes
1answer
34 views

Handle two different touch gestures at same time without overlapping

I'm trying to create a Character touch controls for 2d platform. In my script Im using one horizontal swipe and hold touch gesture and one vertical swipe gesture without hold.Both are different ...
3
votes
1answer
63 views

Distinguish touch gestures for distinct horizontal and vertical commands

In my script below I'm using horizontal and vertical swipe gesture to move the character but both gestures are called on a single touch. void Update () { HorizontalSwipe(); VerticalSwipe(); } ...
0
votes
1answer
25 views

Swipe and hold character movement not working

Heres my PlayerControl script void Update () { foreach (Touch FingerTouch in Input.touches) { if(FingerTouch.phase == TouchPhase.Began) { ...
-2
votes
1answer
131 views

increase and decrease coin count

I am working in coin system. if the player get the coin it adding to +1 coin. after game over i want to store the coins. if the player again earn coin means the new coin want to add with existing ...
3
votes
2answers
157 views

How to avoid Walls in A*

Well I had a problem with the implementation of my A* algorithm in C# for unity, and I don't realize how to prevent the diagonal movement and the cross walls, I had the next code, the print line's are ...
0
votes
1answer
15 views

New textblock after click on button

I have made a box where you can type in your name in unity. After typing your name you can click on the button. Clicking on the button it will copy the string that you typed in within a sentence. so ...
2
votes
0answers
35 views

Record voice and Comparison prefab audio in unity

I am android programmer that i Comparison Entrance voice with ready voice(prefab voice) for example when you say hello >>>>>to analyze>>>>>if your voice == prefab voice >>>>>you listen hello(play ...
2
votes
0answers
122 views

In Unity, how do I make a 3D flight arc preview?

I'm stuck on how to make a preview trajectory for a projectile appear when holding a button. The trajectory should start at a certain position on the scene and end wherever the player points their ...
3
votes
1answer
56 views

How i can have Disposable Script in unity(once run)

I have problem in unity that i do not know how i can have one shot script same void Start() for example i want have below script: Void Start(){ if(x == 2){ Destroy(gameObject); } but it is not ...
3
votes
1answer
77 views

How i can control button input android?

i am android programmer and i want control button input in android for example i made a game that when you press back button in android mobile nothing happens but i want quite from game. This is ...
1
vote
0answers
41 views

Need to save UI.Image to png

I have ui.Image1 with Mask component and ui.Image2 that is placed inside ui.Image1, then I want to save the result to Texture2d to save the resulting image to png. Sprite sprite = sourceImage.sprite; ...
2
votes
1answer
39 views

Find out hit child with RaycastHit

Let's assume having a (2d-) gameobject with 3 images: Head, body, feet. By using RaycastHit2D I can find out if the gameobject was hit (for example by the mouse): RaycastHit2D newSelectedObject = ...
1
vote
2answers
70 views

Interaction between GUI and character(s)

This is more a question about architecture. Not sure if there's a right or wrong: Let's assume I have some gameobjects: GUI: A menu containing some elements like "Go to position". It's opened when ...
1
vote
0answers
207 views

Using unity app how to read the asset in android SDCard?

I am trying to read one file from my android sd card from my unity application, but its not reading. using the asset bundle i have exported my file and kept in my android device sd card and i am ...
0
votes
0answers
37 views

Unity Parallax Strange Effect

I follow this Parallaxing Tutorial: https://www.youtube.com/watch?v=5E5_Fquw7BM for create a Parallax in Unity. I created a custom Script for my GameObjects like this (EDIT: this is in the Update ...
0
votes
0answers
44 views

{Unity3D} Script To Import Assets

I'm making a fps in Unity3D. I would like to know how to import a folder of assets with JS or maybe, but not preferably, with C#. The desired script will reference a directory and tell the code to ...
0
votes
1answer
38 views

Unity GridLayoutGroup children ignoring resizing

Can anyone explain why, in the editor I get: while, on my Galaxy S6, I get: My Panel UI element (which is the parent) has the GridLayoutGroup component, as well as the ContentSizeFitter. The ...
0
votes
0answers
48 views

Unity 2D - GUI box not moving with game object on X axis

I am trying to create a health bar above a spaceship in a 2d spaceshooter. Right now I just need to create a box and move it with the player. I found WorldToScreenPoint() which should work althought ...
0
votes
1answer
39 views

Unity 2D, do Touch event must happen in the update() function?

(Unity 5.1) My Issue is when attaching a script to a gameObject, all the examples I've found are based with the update() function and it's pretty wierd for me, as a desktop games developer. Is there ...
0
votes
0answers
109 views

Google Cardboard Application is not Running on moto G 2nd generation mobile

I am working on the Google cardboard application, here i am using the unity to develop the cardboard app. I have tested the application in moto g 2nd generation here application is not running smooth, ...
0
votes
2answers
91 views

How to check if an GameObject exists in Unity2D? (Javascript)

Im making an AI that checks if the player exists or not. How do I check if a certain object exists and put it in a boolean variable?
0
votes
1answer
73 views

How to get a Vector2 location of an object? (Unity2D javascript)

I need to make an "AI" that makes a ball try to touch the player. But Vector2.MoveTowards()needs a Vector2 variable but how do i get the location of an object?
1
vote
1answer
74 views

Player launches into air when hitting steep slopes

I've been debugging an issue where when my player is moving forward at high speeds (I have configurable movement modes for an overview/overwatch mode) if they are in walk mode and hit a steep slope ...
-1
votes
1answer
122 views

Quaternion.Lerp not working properly in Unity3d

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate with only 5. Any thoughts please? ...
0
votes
1answer
130 views

Unity - Jump counter for double jump script not working? C#

It was working fine last night but it doesn't work today, the zJumpCount stays at zero after I jump now. If the zJumpcount stays at zero my double jump code doesn't work. I even ctrl+z'd back to the ...
-1
votes
1answer
81 views

How can I can create a world that a player can easily get lost in? [closed]

I am a 3D environmental artist and I'm currently planning an independent passion game project of mine. I have the concept of crazy hallways that lead to the rooms that the player has already visited, ...
1
vote
2answers
861 views

Get the current time of animation using script Unity3d

I want to know the current time of the played animation using script in Unity3d. I tried using currentState.normalizedTime but this time is not the time of the animation, like it's the time of the ...
0
votes
0answers
347 views

Unity3D - Unable to attach script to GameObject prefab at runtime

I've got a script that manages a scene browser within my application where I'm hoping to generate a new button instance for each scene found. I've put together a button that I've made into a prefab ...
0
votes
1answer
65 views

2D Lock x Axis on character

I am creating an endless runner with a flying character. I want to lock any movement in the x axis so that the character object can only move up and down but still move forward through the scene. I ...
1
vote
1answer
116 views

Unity sprites and layouts

I am trying to learn Unity for a simple board game. The question is, is it possible to use grid layout group (or any layout component) with sprites? The goal is to fit a board into my view regardless ...
-1
votes
2answers
94 views

How to make different 2 object's collider with the same location in Unity 2D

I have made my own game, but I can't change the object's collider properties from the interface. I can't click on the expand button, because behind it there are other colliders. How could I change ...
-1
votes
1answer
884 views

Unity Ui slider volume control

I have the ui slider to control my volume, I have my slider to control all the volume of the game. I have make it so when the main slider change value all the other slider change with it but when I ...
0
votes
1answer
113 views

How do I make one ui slider control all of the game audio?

I use the ui slider to control how loud is the game, what I want to know is how to make one ui slider control all of the game audio?
1
vote
1answer
158 views

How do I use playerprefs to make ui slider keep the sound settings?

I have not use playerprefs before, I want to know how to keep the change of the audio when the player change it throughout the game.
0
votes
1answer
30 views

Error BCE0043,BCE0044 and UCE001 [closed]

I got my code right here: #pragma strict var hSliderValue : float = 0.0; function OnGUI(){ hSliderValue = GUI.HorizontalSlider (Rect (25, 25, 100, 30),hSliderValue, 00, 1.0); ...
1
vote
3answers
845 views

In Unity, how do I make separate mute buttons for sound-effects and music?

I'd like to have a button to mute game sounds and another to stop the game music. How can I do this?
-3
votes
1answer
54 views

Collision detection console log errors?

So the code down below is supposed to load the next scene once the player touches the flag which the code is attached to. I've made sure that is trigger is checked and yet I'm still getting errors ...
0
votes
1answer
86 views

How do I have different colliders against different objects? Unity

Say for example I have a ball, I want the sphere collider to be a certain radius when it comes into contact with one material (material A in diagram) and a different size when it comes into contact ...
2
votes
1answer
107 views

Smooth rotation Unity3d

I have an animation and I modified some rotations of some bones in the animation at a certain frame. What I want to do is how to make the animation in the next couple of frames interpolate smoothly so ...
0
votes
1answer
72 views

Material not changing Unity3d [duplicate]

I have a MeshRenderer mr public variable in script1. I dragged mesh1 from the assets in the mr place in the inspector of script1. mesh1 has a material mat1, I try to change this material to mat2 using ...
0
votes
1answer
601 views

Display and render only a specific object in wireframe in Unity3D

I want to know how to view and render a specific game object (mesh) in wireframe, not the whole scene. I can change the scene to wireframe using GL.wireframe but the problem I want to view and render ...