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

learn more… | top users | synonyms

-1
votes
1answer
21 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 ...
-4
votes
0answers
73 views

Unity - C# How to create very Big Number?

public static float a = 9999999999999999999; This is the biggest variable that can create. but is not enough for me I need to get to this public static float a = ...
0
votes
1answer
31 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?
0
votes
1answer
23 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
15 views

Error BCE0043,BCE0044 and UCE001

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
69 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
40 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
41 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 ...
1
vote
1answer
70 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
32 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
66 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 ...
0
votes
3answers
87 views

How to change the gravity with a click

How to change the gravity of a ball upward with a click Then change it again downward with another click And so on In unity
0
votes
2answers
51 views

Color submeshes in unity3d

I have a main_mesh that has 10 submeshes, I wonder how I can change the color of of these submeshes to a different color (e.g submesh1 will have a red color, submesh2 will have a blue color,...etc). ...
0
votes
1answer
52 views

Access different vertices of a Mesh Unity 3d

I have a mesh and I want to color each group of vertices with a certain color. If anyone could please advise how this can be done in Unity using coding?
2
votes
2answers
197 views

How to apply a script to multiple Objects in Unity?

In Unity, I've almost 200 or more objects. I wish to apply single script to all those objects. I'm a beginner & learning scripts in Unity. Edit: At the time of editing the scene itself.
1
vote
1answer
43 views

Character controller going down slopes

When I go down slopes with character controller, if the speed is too high, the character just flies off the slope and lands at the bottom. I want my character to "stick" to the slope rather then just ...
0
votes
1answer
23 views

Scaling of a bone is working while rotation is not Unity3d

I'm using Unity3d and I'm trying to rotate the left leg bone of an avatar but it is not working although scaling is working well. This is the code used for scaling and is working perfect: ...
1
vote
1answer
102 views

Unity: How to get a GameObject programmatically?

I have created a prefab. In Unity Scene editor, I dragged the prefab into the scene and named it PrefabA (this is a GameObject instance of the Prefab). Now, I need to update the PrefabA position. How ...
0
votes
3answers
70 views

How to check distance between two different vectors?

So I have a very basic racing game, where I would like the car to stop once it hits the finish line. Respectively when the distance between the car and the finish line hits or goes under 0 the car ...
2
votes
1answer
144 views

Is Physics2D.BoxCast a safe alternative to a row of raycasting?

Raycasting in rows is a common practice. Is using the Physics 2D BoxCast function a good alternative to using multiple raycasts spread out (an example use being collision detection in a custom ...
1
vote
1answer
132 views

What would cause my script generated buttons and text to show in Unity and not on my phone?

I am using Unity 5 and the built in GUI tools. My static GUI shows up just fine which makes me think it's not a text/font issue or some such. Again, it all looks good in the Unity editor when I hit ...
0
votes
0answers
46 views

Unity - UI Mobile - Script Generated buttons/text not seen?

I'm trying to generate some buttons and text dynamically with Unity 5.0 All of my code seems proper. It looks great when I play it in the editor. Everything is generated and placed and sized as I want ...
1
vote
2answers
49 views

player does not collide with walls unity 5

I just started a new proyect with a personalize first person controller, like arrow move style, it worked, but when I tryed to collide it with walls it did not happen, I tryed adding a capsule, then ...
-2
votes
1answer
73 views

how to change trail renderer start width dynamically by script in unity?

I created a prefab that contain a trail renderer to make a drawing sprite in GUI, then i put it into a gameobject in a script. I want to change the start width or end width of the trail renderer ...
0
votes
1answer
86 views

How do I make the ui button to move my character? [closed]

How do I make my character move left,right and jump when click ui buttons using this code? using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public float maxspeed = ...
0
votes
0answers
22 views

How do I make Ground Check stop rotating with the character when it rotate? [duplicate]

How do I make my character routice without Ground Check rotating with it, but still follow my character? Code: using UnityEngine; using System.Collections; public class Player: MonoBehaviour { ...
0
votes
0answers
18 views

Character fixed angle? [duplicate]

I want my character to rotate so I turn off fixed angle in Rigidbody 2D, but the problem here is that I can't jump in any other angle except for the angle where I have my groundcheck. Can anyone help? ...
0
votes
1answer
33 views

How to write a script for circular motion?

Сan any body explain me the script for the tangential motion,so that when i cut the rope circle should move tangentially:
0
votes
0answers
38 views

Character can't jump in other angle with fixed angle off

I turn off fixed angle so my character can rotate, but it can only jump in 1 angle but I want it to jump in every angle. How do I do that? Code: using UnityEngine; using System.Collections; public ...
2
votes
1answer
75 views

Unity 3D - Rotating an object in relation to its velocity

I am currently trying out Unity 3D and I've run into a problem. The problem is I have a car that moves along a road and then when it reaches a corner I would like it to turn the corner and have the ...
2
votes
1answer
59 views

Multiple enemy collidiers

I currently have an enemy that upon collision kills the player with a kill script, I want to add another collider that acts as the visibility radius for said enemy. However, when adding another ...
0
votes
2answers
156 views

How do I make my character jump in any angle?

My character is a square which can spin in any angle but it can not jump in certain angle Can anyone help? using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public ...
2
votes
2answers
44 views

Unity2D Sprite flips camera when moving left and right

I am using the Unity Engine and coding in C#. I have a sprite as a parent with a main camera as a child so that the main camera follows the sprite. However, when pressing 'A' and 'D' to move the ...
1
vote
2answers
115 views

How to move a cube withour rolling it?

I am trying to move a cube with my keyboard on a plane surface. However, the cube always rolling instead of moving. How could I slide the cube on the plane? What I have done: I added a plane game ...
1
vote
1answer
83 views

How do I make my character stop going left? (Unity)

So I have this code and my character can go left, right and jump. I don't want the character going left , so how can I remove that. (I'm very new with coding) using UnityEngine; using ...
1
vote
1answer
213 views

Animator has not been initialized

My animation is working but unity keep saying that my Animator has not been initialized error Here my Code: using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public ...
0
votes
0answers
45 views

Errors Generating A Plane Mesh Using A Script In Unity

In unity I have a script which is attached to a game object with a mesh filter. The purpose of the script is to generate a flat plane of 100x100 vertices. The code for the script compiles in ...
0
votes
1answer
65 views

Trying to get reference to Button in Javascript Unity3d

I've this simple script in Unity3d: #pragma strict public var topLeft : UnityEngine.UI.Button; public var topCenter : UnityEngine.UI.Button; public var topRight : UnityEngine.UI.Button; public var ...
0
votes
1answer
89 views

How do I use rigidbody2d.AddForce to apply a force in the direction the object is facing?

I'm trying to create a thruster on a spaceship. It should add this thrust in the direction the thruster is facing, but I am at a loss on how to get that direction and send it to AddForce. Am I even ...
1
vote
1answer
75 views

Understanding animations of controllable characters

I am a newbie trying to learn basics of Unity3D (5) before starting to do the real thing. Even though I tagged it as Unity3D, the logic should be the same for every kind of game engine. So I will be ...
0
votes
2answers
281 views

Unity C# 2D Platformer Enemy Patrolling

I'm setting up a basic mario-like 2D Platformer and i'm trying to give 'enemies' a patrolling path on a platform. (just like the turtles in Super Mario Bros). All they do is patroll from left to right ...
0
votes
1answer
208 views

how to Move Player on “Z” Axis 2D Movement

first im little new to unity..currently im working on 2D game mobile game.and im using Stranded Asset(Mobile) Single Joystick prefab to move Player..Currently my player move on X and Y axis. can any ...
-2
votes
1answer
41 views

Script to change size of a cube when pressing a button [closed]

I am very new to coding and very bad at it. In my environnement there is a table, and i would like, after pressing a keyboard button, to make a cube appear. Then, by pressing another button, i would ...
0
votes
2answers
48 views

unity2D Top-Dow Mobile rigibody2D

im using this code for my 2D TopDown mobile player movement.but when i move player With UI Image buttons player keep moving.it didnt stop.and also player starting of move he is very slow. the he ...
2
votes
1answer
228 views

How to enable IntelliSense for Unity scripts in Visual Studio?

I am using Visual Studio 2013 pro and Unity 4.6. Whenever I write scripts (javascript or c#) for anything and open it up in Visual Studio, I don't get IntelliSense. How to fix this issue?
0
votes
0answers
13 views

I want to swap textures on button click [duplicate]

public class Textswap : MonoBehaviour { public Texture imageone; public Texture imagetwo; private Texture gametexture ; void Update (){ if(Input.GetMouseButtonDown && gametexture ...
0
votes
2answers
193 views

How to make legacy animations run in Unity in unscaled time? (Pause game related)

I'm relatively new to Unity, and I've been having a very difficult time getting the legacy animations to run in unscaled time. I need to pause my game, and as soon as it pauses, I need to have my ...
0
votes
0answers
135 views

save and view snapshot image from android device

I'm having a problem with saving image into an android device this is what i did My java class : package com.test.app; import com.unity3d.player.UnityPlayerActivity; import android.os.Bundle; ...
3
votes
1answer
111 views

Cannot use DLL in my Unity project

I'm pretty new in Unity and i'm trying to write reusable code to use across multiple "project". So I wrote this class to POST and GET highscore via WebRequest. I compiled the project to a DLL and ...
0
votes
0answers
153 views

front camera not working in unity 3d android

i have this peace of code : public string deviceName; WebCamTexture webCameraTexture; public Text txt; private WebCamDevice[] devices; private WebCamTexture webCam; // Use this for initialization ...