The unityscript tag has no wiki summary.
2
votes
0answers
31 views
Copy a folder in Assets/Resources folder programatically depending upon a constant
I have a Unity3d project in which I have 200 games and some 350 scenes. Now I want to make separate builds for each game. All my assets are present in Assets/IgnoredAssets/ABC folder. To include these ...
1
vote
0answers
34 views
Unity 3d 4.6b New GUI system doesn't take touch when already a touch event is occurring in 3d scene
I know this is beta version but..
I have a Canvas->Button which works fine when I tap it normally.
I have a joystick in my scene which is drawn by separate camera other than mainCamera.
now, while ...
1
vote
2answers
99 views
Why should I use getcomponent?
I have already referred the animator by using the statement,
Animator anim;
But,What is the use of getcomponent in awake() function.What happens without it.
1
vote
1answer
81 views
What does Quaternion.Lookrotation do?
I have this code,
if(Physics.Raycast(camRay,out floorHit,camRayLength,floorMask))
{
Vector3 playerToMouse = floorHit.point-transform.position;
playerToMouse.y=0f;
Quaternion newRotation ...
0
votes
1answer
35 views
How to make it two seconds for Time.time?
var targetscript : Diamond;
var red : Color;
var orange : Color;
function Start () {
gameObject.camera.backgroundColor = red;
}
function Update () {
if (targetscript.score > 4) {
...
0
votes
1answer
21 views
Align SpriteText position
i have this function which aligns text.
static function AlignTxt(obj : GameObject, txtAnchor : SpriteText.Anchor_Pos,
txtAlign : SpriteText.Alignment_Type)
{
...
-1
votes
0answers
38 views
How to end game properly in unity? [duplicate]
I have made a game in unity free. The game is functioning properly but if your computer receives any kind of notification, the game minimizes automatically and stops to work completely. Along with ...
4
votes
1answer
181 views
Prefab random rotation in editor
Is it possible to automacicaly random rotate pefab during placement in editor in unity 4.5.3?
I can make it autorotate in game(at start) but I want it to be visible in editor and at fixed rotation ...
1
vote
1answer
52 views
touch.phase == TouchPhase.Canceled not worked
i m tired to handle and solve issues related to multitouch. i m use maximume 5 touch simultaneously but when two touches are down on two object and i moved my fingures then that both touches fired ...
0
votes
2answers
127 views
Instantiate prefab randomly but not in already occupied position
I want to generate bubbles randomly on screen. When a bubble is generated in one place then other bubbles should not be generated near its radius 1 area, so they can not collide or trigger with any ...
1
vote
2answers
96 views
Unity3d - Playerprefs not saving
Im trying to make a script to save the player settings like volume and field of view.It used to work before but it suddenly stopped for some reason.This is the script Im using(a part of it actually) :
...
-2
votes
2answers
114 views
AI shooting through walls [closed]
I made a AI shooting script for my new game but the problem is that the AI ignores the walls and shoots through walls. This is my ai script :
#pragma strict
public var rocketPrefab : Transform;
...
0
votes
2answers
40 views
different Scenes but each of them loads per frame
well i want to have something like restaurant that divided in 3 sections.and the user can switch between these but every Scene loads every frame.for example the character is in the first section and ...
2
votes
2answers
141 views
How to be sure that a target goal in a match 3 game level will not be impossible?
This is clearly not a coding problem but the logical one. I am starting to learn how to make a match 3 game.
but there is a question rising in my mind.
when i will set goal to complete the level, how ...
0
votes
1answer
53 views
Unity3d : Make prefab follow raycast hit
I've been trying to make a weapon script which fires a projectile (prefab) straight forward.I added to the bullet the first script shown here.And the second one to the main camera.The problem is that ...
-2
votes
1answer
81 views
Animation not playing correctly(or at all)
Im created this script which plays animation/s when the player goes close to it and presses e while aiming at it.For some reasons only the first animation is playing,not the second one.Is there any ...
0
votes
1answer
98 views
Generating a particle effect on top of a GUIElement (Unity)
I am working in Unity on a 2D project which is using C#.
I have a number of guitextures which are hearts in order to create a sort of life meter. I would like when the player loses a heart for the ...
-1
votes
1answer
59 views
Unity3d : Animator canceling script
I create a sway script for my flashlight and attached it to the gameobject(flashlight).
Now the problem is that when I enable the animator in the gameobject(flashlight) the sway doesnt work,but when ...
0
votes
0answers
322 views
Unity Android Unable to convert classes into dex format AdMob
I'm a beginner Unity programmer (school-age), so I don't know that much about the system. On its own my app compiles fine, but when I implement the AdMob SDK (Google) 2.1, I have the following error ...
1
vote
1answer
66 views
How to use sprite as font in Unity?
I've started working on my first game in Unity; It's very simple, there's a spinning block in the middle, and there are spinning blocks coming from all sides. When they hit the middle block, you lose ...
0
votes
2answers
101 views
Make a square flickering at a preset frequency
I'm working on a medi-sci project where I want the patient to use brainwaves to exercise control the environment.
The environmnet is a 2D game where the game character is to be controlled by 2 ...
-1
votes
2answers
156 views
How can I read inputs from buttons at the same time?
I am using the tk2d toolkit.
For my project, each player has their own button. I need to be able to get both buttons inputs (at the same time) so that I can figure out which up event first.
I run ...
3
votes
1answer
265 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
161 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
226 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
288 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
98 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
96 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
56 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
138 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
305 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, ...
1
vote
1answer
119 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
202 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
119 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
654 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
377 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
348 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
563 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
89 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
221 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
41 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
963 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
120 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
174 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
60 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
2answers
833 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
561 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
1k 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
281 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
258 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 ...