Unity is a cross-platform game creation system that focuses on easy art pipeline process. It consists of a game engine and an integrated development environment. The game engine's scripting is built on Mono.

learn more… | top users | synonyms (1)

1
vote
3answers
186 views

Algorithm for securing a retro password system

For a game I am working on, one of the build targets is the Unity Webplayer, which does not support saving file I/O at all. However, as it's an action/adventure game based on Zelda 2: The Adventure ...
1
vote
1answer
2k views

Unity3D Drag Object with Mouse Gives Invalid Position

I am trying to implement a simple script to drag a GameObject with the mouse in Unity. However, when the position of the object is updated with the following script, I get an error saying: ...
-1
votes
1answer
137 views

Show message to one player issue in multi-player game

I Needed to show message to only one person of the multi player game,i am using smartfoxserver to developed a board based game and in this game how to differentiate 2 players in unity c#,and also how ...
1
vote
1answer
2k views

How to slide a non-kinematic rigidbody?

I'm studying Unity3d, coming from a 2d background, and I'm a bit confused how some things work. I'd like to slide a non-kinematic rigidbody, i.e. "just move it forward", like if it was hovering over ...
0
votes
0answers
151 views

Unity3D object fill shader

I've been researching this for a while, and had no luck yet. I figured I'd ask here to see if anyone had any good ideas. Essentially what I want is a shader that can make only part of an object ...
0
votes
0answers
764 views

How do I use UsePass in a shader in Unity when the pass does not have a name?

I'm trying to use passes from a given built-in shader in Unity. The docs say that the syntax is UsePass "Name". The problem is that built-in shaders don't have names on their passes. How could I do ...
0
votes
1answer
322 views

How to stop camera from rotating in 2.5d platformer

I'm stuck with a problem: I can not make my camera stop rotating after character. What I already have tried: using empty game object with rigid body and locked rotation and make it parent of camera, ...
2
votes
1answer
362 views

Project collision shapes to plane for 2.5D collision detection

I am working on a top down 2.5D game. In the game anything that overlaps on the screen should be 'colliding' with each other regardless of whether they are on the same plane in the 3D world. This is ...
-1
votes
1answer
245 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 ...
0
votes
0answers
266 views

Design virtual resolution for 2D development in Unity

I came to Unity with Cocos2D-X experience in mind. In Cocos2D-X, I can choose a "virtual" screen resolution size to rely on the entire game during development and the game will automatically adapt to ...
2
votes
2answers
1k views

Rotate to a set degree then reverse and repeat in Unity

I'm making my first project in Unity, a simple game where touching objects adds points to the player's score. I'd like the objects to have a pleasant back and forth swaying animation on the Z axis. ...
1
vote
0answers
235 views

With 2 superposed cameras at different depths and switching their culling masks between layers to implement object-selective antialising:

We superposed two cameras, one of which uses AA as post-processing effect (AA filtering is cancelled). The camera with the AA effect has depth 0 and the camera with no effect has depth 1 as can be ...
3
votes
1answer
131 views

Why am I getting a mirrored mesh out of my data structure?

I'm in the beginning stages of an RTS game in Unity. I have a procedurally generated terrain with a Perlin noise height map, as well as a function to generate a river. The problem is that the ...
1
vote
1answer
464 views

Android Swipe In Unity 3D World with AR [closed]

I am working on an AR application using Unity3D and the Vuforia SDK for Android. The way the application works is a when the designated image(a frame marker in our case) is recognized by the camera, a ...
2
votes
1answer
193 views

how to android touch in Unity?

I am creating simple game for android.I used touchphase.moved to power up my ball and touchphase.ended to throw the ball.But what happened is the ball is thrown when I moved my finger in both x and y ...
1
vote
1answer
3k views

How to opitimize Shadows in Unity 3D

I made the shadow of Solider in my game using Unity pro shadows feature. http://docs.unity3d.com/Documentation/Manual/Shadows.html The performance of my game becomes very slow after adding these ...
-1
votes
1answer
184 views

Unity 2D sprite support? [closed]

Does Unity 3D support 2D sprites yet? I know that they have mentioned it in a blog post but I don't know if that feature has gone live yet
1
vote
0answers
793 views

OnTriggerEnter not called [closed]

I am working on a fight game with 3D models but played like a 2D game. So the player characters have swords. The Player GameObject has several body parts that are colider triggers. The sword is a ...
4
votes
1answer
664 views

Polygon count budget

Is there any smart way to think about polygon budget relating to PC gaming today? My game will have one static 3d background scene and two fighters. No more enemies. I am thinking about having ...
2
votes
0answers
228 views

dynamic 2d texture creation in unity from script

I'm coming from HTML5 and I'm used to having the 2D Canvas API I can use to generate textures. Is there anything similar in Unity3D? For example, let's say at runtime I want to render a circle, put 3 ...
2
votes
1answer
2k 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
1answer
354 views

Text resource not loading

I'm trying to load text from a .txt file into a TextAsset variable. The file is in the assets folder under Texts/. My problem is that bindata is returned as null. string instructions; void Start () ...
1
vote
1answer
377 views

Non OnGUI based progress bar

How can I make a progress bar appear in Unity that doesn't make use of the OnGUI functionality in C#? I'm doing something with an Oculus and the OnGUI stuff doesn't work too well in a stereoscopic ...
1
vote
1answer
1k views

How to automatically render all opaque meshes with a specific shader?

I have a specular outline shader that I want to be used on all opaque meshes of the scene whenever a specific camera renders. The shader is working properly when it is manually applied to some ...
7
votes
3answers
394 views

Slerping rotation mirrors

I rotate my game character to watch at the target using the following code: transform.rotation = Quaternion.Slerp(startQuaternion, lookQuaternion, turningNormalizer*turningSpeed/10f) ...
3
votes
1answer
558 views

Animations not accepted in animator

In the official Unity Animator State Machine tutorial video animation clips are dragged out from the assets folder into the animator and dropped. I have a 3D model that i bought online to experiment ...
-1
votes
1answer
723 views

Unity GUI not in build, but works fine in editor

I have: GUITexture attached to an object A script that has GUIStyles created for the Textfield and Buttons that are created in OnGUI(). This script is attached to the same object in number 1 3 ...
0
votes
2answers
1k 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
1k views

How do I have multiple audio sources on a single object in Unity?

I have an audio system set up wherein I have loaded all my audio clips centrally and play them on demand by passing the requesting audioSource into the sound manager. However, there is a complication ...
5
votes
1answer
1k views

How do I create a 2.5d parallax effect?

I have a decent background in 3D graphics and programming, but I'm new to game development. I'm currently exploring different possibilities and I really want to make an RPG game. I was thinking about ...
1
vote
2answers
165 views

GameObject in hierarchy needs to know who it belongs to

I have two objects from the same prefab. They have bodies and swords. What good options do i have to check if a sword belongs to player2 or player1? For example when body registers that it has been ...
0
votes
1answer
376 views

Rotating object along bezier curve: not rotating enough?

I tried to follow the instructions from the threads on the forum (Cocos2d rotating sprite while moving with CCBezierBy) with Unity, in order to rotate my object as it moves along a bezier curve. But ...
0
votes
1answer
573 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
1answer
548 views

Unity AddExplosionForce not doing anything

Recently I've started learning Unity3D. I'm working on a game as an exercise in which you control a space ship and have to dodge asteroids. If you feel like it's getting a bit too much you can hit the ...
0
votes
2answers
1k views

OnTrigger not firing consistently

I have a Prefab called Player which has a Body and a Sword. The game uses 2 instances of Player, Player1 and Player2. I use Player1 to strike Player2. This is code on the sword. My hope is that ...
1
vote
1answer
2k views

Jumping with Mecanim synchronization

I am using Unity3D 4.1 for one of my projects. I have a robot character which is always running. I am using mecanim animation system. What I really want:When I press Space bar, the character should ...
1
vote
3answers
3k views

How to Use Text in Unity3d

How Can i Create Text in Unity3D? I Use "3D Text" But Its Always on Top Of Everything! Can You Suggest Anything? I creating a 2D Game So its not Necessarily a 3D Text.. Edit: Because I Building a 2D ...
7
votes
2answers
468 views

Coroutines in series

How would i go about stacking up a series of Coroutine calls that should be executed one after the other? I have tried getting a flashing color effect looping a series of color lerps in a coroutine ...
3
votes
1answer
2k views

How do I make the camera focus on a moving game object with ITween?

I'm trying to write a solar system with Unity3D. Planets are sphere game objects rotating around another sphere game object representing the star. What i want to achieve is let the user click on a ...
0
votes
1answer
477 views

Getting and playing AudioClips by string name

Is there anyway I can get an audioclip by the name it has in the assets folder? Or will I always have to make a reference to it by dragging and dropping the clip on a SoundClip in the inspector?
4
votes
1answer
312 views

Keep cube spinning after fling

So I've been trying to get started with game development for Android using Unity3D. For my first project I've made a simple cube that you can spin using touch. For that I have the following code: ...
1
vote
1answer
191 views

Best practice child and parent script [closed]

What is the best practice coming to wher to place the code in this scenario. I have a gamobject called player. It has lots of child objects. One of them is sword. Like this: Player Body Head ...
9
votes
4answers
5k views

How to change Gravity towards certain object in Unity?

I have two spheres in Unity. One is 1000x in size other is 1x in size. So I want the smaller sphere to be attracted to bigger sphere. So how do I do it. I know that it can be down through gravity ...
0
votes
1answer
967 views

Directional light causes an FPS drop

I have only one object in the scene and it is lit with a directional light. It uses the mobile/diffuse shader. The issue is that on iPhone 4 the FPS drops from ~42FPS to ~11FPS when the directional ...
0
votes
1answer
197 views

Unity Extension method with coroutine

Is it possible to have extension methods that starts coroutines? Id like to have an extension method for the GameObject that checks if itself has a renderer and a material and then lerps the color to ...
2
votes
1answer
103 views

Is it possible to tell Unity3d to ignore part of its hierarchy?

One aspect of the game I'm making is each level is made up of room objects, which contain the sprites, physics objects and so on. When you enter a level the whole level is deserialsed and loaded into ...
0
votes
1answer
338 views

How to code camera for layered map in unity

For a current unity project I need a layered map like in Dwarf Fortress. The game will take place in a 3D city enviroment and the camera should be 'snapped' to layers. So there will be (for example) a ...
1
vote
2answers
3k views

Unity Extending Game Object best practice

What is best practice when wanting to add to GameObject class? I would like all GameObject to be able to change color IF they have a renderer. Ive tried using a helper class that takes a GameObject ...
0
votes
2answers
778 views

Unity Mesh and Collider not aligned on rotation

I have a GameObject with a mesh and a collider. When I rotate the object the mesh and the colider do not act the same way and when the GameObject is rotate 65 degrees on the z axis the mesh and the ...
0
votes
1answer
608 views

Unity Sound effect playing too many times

In the class PlayerControl I have this if (Input.GetKey("space")) { soundManager.PlayBleep(); sword.SetActive(true); } In my soundmanager I have this public ...