-1
votes
0answers
41 views

2d top down tank movement

I am trying out an idea of a tank like movement in a top down 2d game. I'd like to: get the float values of both left and right triggers I have from an xbox controller (float values from 0 to 1). I ...
0
votes
1answer
44 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 ...
0
votes
1answer
109 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 ...
1
vote
1answer
38 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
149 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 ?
2
votes
1answer
142 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
158 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
218 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 ...
-1
votes
1answer
101 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
230 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
62 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
115 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
488 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
518 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
167 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 ...
0
votes
2answers
693 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
86 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
122 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 ...
1
vote
2answers
174 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
193 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
674 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
108 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
274 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 ...
0
votes
1answer
449 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
226 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
236 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
459 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
328 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 ...