The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
3answers
107 views

How do I define a required component on a Unity game object?

I have a script that expected the game object to have a Terrain component. Is there an attribute I can add (or some other way) which will prevent a designer from adding my ...
0
votes
0answers
20 views

How to control animationClip though scripting or button pressed

I am stuck in my project designing Game Menu in unity. I am using NGUI plugin free version. I created image button and animated in animation view. It made animationclip and added in animator ...
0
votes
1answer
29 views

How to increase the rotation of a quaternion by a percentage of X % in a Unity script?

There is a simple way to increase the rotation described by a quaternion by a percentage X? Sorry, but in the documentation of Unity3D I found nothing and I have a poor knowledge on the topic.
0
votes
2answers
48 views

StartCoroutine function inside TriggerOnEnter2D not working - unity + kinect

So i'm using Kinect with unity to track user's hand movements, and let the user's hand act as a mouse, I have written the code to detect a collision between a button (sprite object) and the hand ...
0
votes
0answers
22 views

Drag object on the XZ plane

I wrote a script to drag an object on the XZ plane. It works good when the object is close to the camera's position. So here is the code: using UnityEngine; using System.Collections; public class ...
-1
votes
4answers
116 views

Scripting vs Programming [closed]

How does using Scripting and calling functions of scripting API differ from programming using C++ in UDK or Unity?in scripting we use the scripting API to interact with the engine and use functions ...
0
votes
1answer
36 views

NGUI Texture Background Font of Sprite

I am new to Game Development and using NGUI plugin free version. There are few sprite images in my game. I made them prefab and instantiated at runtime. then I created NGUI Texture and Made it ...
0
votes
0answers
15 views

iTween.LookTo works only when the boolean gets changed

im trying to rotate an object when the player gets too close to it but it only rotates when the player leaves leaves the range for 0.5 seconds or less. It does the same if i use ontriggerenter and ...
0
votes
0answers
51 views

Random Object in Array

I am using Unity3d. I am stuck in my game. I Couldn't find the solution yet. I have created 8 different types of objects, stored in array, . i displayed them on the scene randomly in grid pattern. ...
-1
votes
1answer
46 views

How to increase player Lifes count

I am new in Unity Game Development. I am designing infinite game using C# scripting. There are many cubes in my game scene. if single cube is hit by player, He gets 100 points. if same color, two ...
0
votes
1answer
43 views

How to write a unity script to observe the position of a game object (during scene creation)

I want to write a simple Unity script to be notified when a game object is moved, during the creation of the scene. More precisly, I want to write a Unity script that can recognize when the user ...
-1
votes
1answer
92 views

Unity 3D: Raycasting for gun hits

I am having trouble understanding raycast hits in Unity3D. I am trying to create an FPS game, so I have a gun, bullets and so on. My script for the bullets is: var Bullet : Transform; var Spawn ...
0
votes
1answer
48 views

Raycast doesn't point on the right direction

The raycast line im rendering is acting weird, it doesn't point where I want it to. I want it to point from the yellow object to the selected one but it draws it at another position. Here is my ...
2
votes
0answers
45 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
227 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
118 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
253 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
48 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
31 views

Align SpriteText position

i have this function which aligns text. static function AlignTxt(obj : GameObject, txtAnchor : SpriteText.Anchor_Pos, txtAlign : SpriteText.Alignment_Type) { ...
4
votes
1answer
201 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
98 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
259 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 ...
-2
votes
2answers
148 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
43 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
167 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
144 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
158 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
210 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
79 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
1answer
589 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
84 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
121 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
213 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
536 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
257 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
414 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
748 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
135 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
163 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
105 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
264 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
640 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
150 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
241 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
152 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
2k 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
855 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 ...
2
votes
1answer
728 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
1k 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
101 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. ...