The unityscript tag has no wiki summary.
-1
votes
0answers
20 views
Unity : My Space button working in unity engine but when i make exe its show null reference exception [on hold]
please guide me that how can i fix the problem . the porblem is that my jump button which i set SPACE is working in unity engine but when i make the exe of this then the space input of keyboard shows ...
1
vote
1answer
54 views
How to compress Unity apk output?
I made a game with Unity but the size of .apk file got so large, it is about 70mb...
Is there some way that I can compress my apk file?
0
votes
1answer
35 views
Make GuiText responsive
I'm using C# code to make a responsive GuiText.
I was abel to make a responsive GuiTexture, but I'm struggling with doing the same for a GuiText.
Code for the responsive GuiTexture
using ...
-2
votes
1answer
79 views
Unity3D - Clones won't get destroyed by script
I need some help making this script work.
#pragma strict
function OnMouseDown () {
Destroy (gameObject);
}
Basicly what the script does is that it destroys the objects that the player clicks on.I ...
0
votes
4answers
112 views
Scripts won't affect clones - Unity3d
I made a script which swaps two game objects on click.But the script won't work because the objects are actualy clones of the original prefab.
This is the script (UnityScript):
#pragma strict
var ...
0
votes
1answer
59 views
I want to make a pause button on the scene
I want to make a pause button on the scene. If I press the button it will show the guiTexture with a variety of buttons with each different script. So what steps should I take?
1. How do make it so ...
0
votes
0answers
49 views
Assigning valid moves on board game
I am making a board game in unity 4.3 2d similar to checkers. I have added an empty object to all the points where player can move and added a box collider to each empty object.I attached a click to ...
0
votes
1answer
31 views
Unity - Invert Movement Direction
I am currently developing a 2,5D Sidescroller in Unity (just starting to get to know it).
Right now I added a turn-script to have my character face the appropriate direction of movement, though ...
3
votes
1answer
60 views
curve objects in unity3d to wrap around an invisible cylinder?
Is there a way to transform objects in unity3d so that they can become curved? Imagine that I wanted to create a rectangle that wraps around an invisible cylinder, or that I wanted take a sprite image ...
2
votes
2answers
172 views
How do I get mouse x / y of the world plane in Unity?
I am trying to make a tiled landscape. The terrain itself is not made from tiles but the world has a grid which I define.
I would like to place boxes/rectangles which snap to this grid, at runtime, ...
0
votes
1answer
59 views
Converting a GameObject method call from UnityScript to C#
Here is the UnityScript implementation of the method i use to generate a randomly tiled background, the problem i'm having relates to how to translate the call to the newTile method in c#, so far i've ...
-1
votes
4answers
159 views
How to increase the game “level” after certain amount of objects spawned?
The game is supposed to increase the level by 1 every 10 spawns of an object, using totalShots % 10 == 0. So, when totalShots is equal to 10, 20, 30, etc. the level should increase by 1, however, the ...
0
votes
1answer
72 views
Free Look Camera Like Arma 2 while pressing ALT [closed]
I'm trying to create a simple script that give me the possibility to rotate the camera while pressing a key. So, in a pseudo-code way, how I can intercept the Input event and limit the player's ...
5
votes
4answers
433 views
Does Unity let you code in Java?
I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read ...
1
vote
2answers
93 views
How to change transform.position.x after a state is changed?
When I press attack button, player will change to Normal Attack state to perform Normal Attack animation and you will notice the player seem like step back a little bit as the width of sprite for ...
1
vote
1answer
112 views
How do you set the target location for a navmesh using a GameObject?
I am trying to get a GameObject to navigate through a map and get to the exit. I have created a navmesh for the map and given the player GameObject a navmesh agent. The exit is marked with a empty ...
2
votes
2answers
163 views
android game development using unity 3d [closed]
I want to learn android game development. I dont have any programing knowledge. So should I learn JAVA and eclispe to develop games for android.
Or should I learn Unity 3d. And is knowledge of java ...
0
votes
0answers
61 views
class instance issue
Currently, i am working on a project which deals with several parts.
First, I want to interface with a Sidewinder Force Feedback 2 joystick in Unity using SharpDX and SharpDX.DirectInput libraries.
...
0
votes
1answer
118 views
Increase animation speed according to the swipe speed in unity for Android
I have the animation done through Maya and brought the FBX file to unity. Here is my code to calculate the speed of the swipe:
Vector2 speedMeasuredInScreenWidthsPerSecond ...
1
vote
1answer
40 views
How should I pause a rotation when my character collides with a gameObject?
My character always moves forward and when he enters a turn(Trigger) this is what happens:
if(other.CompareTag("TurnLeft"))
{
// Rotates the character in 90 degrees in 6 seconds.
...
0
votes
1answer
350 views
Unity3D animation trigger reset
How can I reset conditions for animations using an animation controller?
I have a door that will open when a boolean property in a script is set to true. This then calls setTrigger on the animator to ...
2
votes
2answers
84 views
Finding diagonal objects of an object in 3d space
Using Unity3d,
I have a array which is having 8 GameObjects in grid and one object (which is already known) is in center like this where K is already known object. All objects are equidistant from ...
0
votes
1answer
164 views
How to play a video on a TV model inside a game?
I am new to Unity3D. I need to know how can I play news when I switch on a TV using any scripting language in Unity3D ?
-1
votes
1answer
58 views
How do I check in which region of a map an object is located?
For example I have a character and two areas A and B, I want to test which area, A or B, my character is on.
2
votes
1answer
250 views
Retrieve the original prefab from a game object
How would one proceed to retrieve the original prefab used for instantiating an object?
In the editor these two functions work :
Debug.Log(PrefabUtility.GetPrefabParent(gameObject));
...
1
vote
4answers
277 views
Get GameObject to bounce of colliders [duplicate]
I am making a Atari Breakout game with unitys 2d tools and I need to get the ball to bounce of colliders in the scene. If you havent played the game before how it works is if the ball hits the wall at ...
1
vote
2answers
675 views
Retrieve variable from another class and send to another scene in Unity
Sorry for asking a noob question, but I have never used c# in Unity, only unityscript.
Basically I have a public int score variable stored in Players Class.
I need to retrieve it in the following ...
-2
votes
1answer
163 views
Trying to access another class that is outside my Unity script but casting is failing
I am trying to reference a class that is outside my unity script using GetComponent.
private FlyThroughCamera camera;
void Start ()
{
camera = GetComponent(typeof(FlyThroughCamera)) as ...
4
votes
1answer
240 views
Why do my velocity estimates have such a large margin of error
I am writing a script in unity that applies a force to the object to advance it a set distance in an environment without friction or drag, producing a cosine force curve.
However, as the target ...
0
votes
2answers
78 views
Unity3D JavaScript/.NET code throwing compilation error with a List-thingy [closed]
So, I do this:
var intlist:List.<System.Int32>;
intlist.Add(1);
And where I say intlist.Add(1) I get:
NullReferenceException: Object reference not set to an instance of an object
Weird, ...
0
votes
1answer
152 views
Make Gameobject Stand On Surface Facing Certain Direction
I want to make a biped character stand on any surface I click on.
Surfaces have up vectors of any of positive or negative X,Y,Z. So imagine a cube with each face being a gameobject whose up vector ...
1
vote
1answer
807 views
How to get all keys and values of the PlayerPrefs in Unity?
I'm storing player name and scores in the Unity PlayerPrefs. I'd like to list all the names and scores stored in PlayerPrefs and display a high score page:
Is it possible to display all the keys ...
0
votes
2answers
807 views
How to display a GUI text at run time in unity?
I'd like to display a GUI text at run time in my game for a second, so I want to know if it's possible to add or remove a GUI label to the scene at run time?
0
votes
1answer
278 views
Making a new instantiated prefab as a child for existing GameObject
I've been searched about how to make these fruit to move as the basket movement if it collided with it, and I've been found that if I want to perform this I've to let these fruit to be a child to ...
1
vote
2answers
925 views
How do you make the first person object the main camera?
How can a first person object character be made to be the primary viewing camera in unityscript? Do I remove the main camera? or just turn one or the other on/off?
-2
votes
1answer
97 views
How to keep a GameObject from dropping?
I am applying the following script to first person object:
function Update () {
var mountain : GameObject;
mountain = GameObject.Find("QuantumCold_B");
...
-2
votes
2answers
150 views
No appropriate version of 'UnityEngine.Transform.RotateAround' for the argument list
Assets/CircularOrbit.js(11,26): BCE0023: No appropriate version of 'UnityEngine.Transform.RotateAround' for the argument list '(UnityEngine.Vector3, System.Type, float)' was found.
Here is what I ...
2
votes
2answers
258 views
How do you reference one game object from another?
I am trying to reference a game object that was created in the editor and added to the scene (not created dynamically). How can I reference this object in a script added to another gameobject?
For ...
1
vote
1answer
215 views
How to circle an uneven object with Camera at a fixed distance?
Unity3d. I am trying to move an object with Camera around a fixed terrain (Mountain), while staying an set distance from its edge. I have the camera set to lookAt the mountain, and I want to circle ...
0
votes
4answers
834 views
sample project that mix unityscript and c#
I like the simplicity of unityscript, at same time I also like the plenty of c# library and open source projects.
I prefer to put my model/controller/logic flow in unityscript using standard unity3d ...
-1
votes
2answers
122 views
UnityScript generating UnityEngine error
I have the following code set out for a simple animation in Unity:
#pragma strict
function Start () {
}
function Update () {
if (Input.GetButtonDown("KeyCode.W")){
...
0
votes
1answer
328 views
Detecting if “Wall” To The Left or Right Of Player Unity3D
I am working on a 3D Platformer in Unity3D and I need to prevent the player from going through walls. The movement for my player works like this:
(A bird-eye-view representation)The areas the ...
1
vote
1answer
572 views
Unity3d how to show an image downloaded from HTTP
I am bit new to Unity3d. I am fine with any solution either of the scripts.
Can we render an image in unity3d (which we have to download from HTTP path)? If yes then how or do you have any reference?
...
0
votes
1answer
261 views
Quit the application when clicking cancel button of Alert View in C#
Can someone guide me as to how can I make an application quit when you press the cancel button of an Alert View in C# code?
Thanks
I forgot to add that I am trying to quit application on clicking ...
2
votes
1answer
287 views
Translating a terrains position using input in Unity 3D C#
I am trying to make a terrain in Unity move, but im having trouble. Here's the code i have.
using UnityEngine;
using System.Collections;
public class NewScript : MonoBehaviour {
Camera camera;
...
0
votes
1answer
560 views
Unity3D GUILayout Window Wont Show Components
I am fairly new to Unity, but picking things up quick. This is actually one of the first problems I have come across that has me stumped.
I am trying to print a good amount of components onto my GUI ...
1
vote
1answer
353 views
No intellisense on my classes
I've been using Monodevelop's current version and Unity 4.
I don't get intellisense on the classes I've created but I do have intellisense on classes that are in Unity's framework. Bug or its just as ...