Unity is a highly cross-platform engine that focuses on easy art pipeline process and uses Mono as its scripting back end.

learn more… | top users | synonyms (1)

1
vote
2answers
59 views

control animation using animator control class

I did a sample existing code to control animation using animation.I dragged and dropped a character into the scene then I added a Animator to it and added the animator controller.Below I have given ...
0
votes
1answer
53 views

Getting a pixel of Sprite at the cursor position in Unity

Summary: I've been trying to figure out a way to use simple box colliders as a nice and efficient "first pass" collider. For the "second pass", I want to check that the area clicked has an alpha value ...
0
votes
1answer
78 views

Gun Bobbing Algorithm Math Explanation

I stumbled across this really neat algorithm which I don't fully understand. It simulates a camera's bobbing effect commonly witnessed in first person shooters while running/walking. I'm mainly unsure ...
1
vote
2answers
90 views

Is Unity NGUI still that usable after Unity has add support for 2D?

I am tempted to refactor out the existing component which uses NGUI ("Next-Gen UI kit") given that what I needed is only the sprite and texture atlas. Since in the newer versions of Unity those ...
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
20 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
vote
1answer
364 views

Unity 4.6 GUI - Dynamically change the functions called by GUI elements

Looking to dynamically change the value in the button OnClick and slider On Value Changed . If I had to guess on how this was done, get a reference to the button/gui element. Next get the Button ...
0
votes
1answer
51 views

Calculating distance travelled

I am working on a road fighter kind of game. The game has its tracks moving to give the effect of car movement. The car accelerates and decelerates as expected with certain keys pressed. But How do I ...
1
vote
2answers
91 views

Unity plane that is normal to Z axis

I want to create a plane that will be normal to the Z axis, but I am having difficulty visualizing what rotation it needs to have. I want to have a top-down view upon the plane such that I can use ...
0
votes
2answers
38 views

How to iterate through the frames of an AnimationClip in editor mode

I'm working on a 2D game, using spritesheets as the basis for four AnimationClips. (Every frame from the spritesheet is a keyframe in the animation.) I'm trying to step through the frames of these ...
2
votes
1answer
72 views

Accessing the command line from in-game?

Is there a way to interact with the command line (Linux/Windows) from in-game using a game engine such as Unity or Unreal? I would like to have the user be able to jump on a console or even just ...
1
vote
1answer
53 views

Unity3D: terrain object's textures flickering on long distances

I'm making RTS project on Unity3D. I created terrain with Unity's standard Terrain tool, and added textures of grass, mood etc. on it. Then, for creating "man-made" objects of terrain (roads, ...
4
votes
0answers
66 views

Normals are changing during animation in Unity

I'm having a very mind boggling problem. I have an animation running on a face object(imported from blender). At a few points in the animation the normals switch direction! It's causing the mesh to ...
1
vote
2answers
126 views

(2D) Detect mouse click on object with no script attached

I'm creating a 2D project which does not have a character. So i created an empty gameobject and attached the script to it. In the script, i have declared other objects which are in the scene like ...
1
vote
0answers
12 views

Disply unity build in flex

We have tried the following methods to upload sample Unity3D build to desktop application in flex:HTML Loader, NavigateToURL, iFrame & resolvePath but it only display the text content not the 3D ...
-2
votes
1answer
50 views

Not able to destroy the prefab

In the code, everything is working smoothly, only problem I am facing is that the Destroy(fuelprefabInstance) is not getting Destroyed in OnTriggerEnter Method though the print statements are clearly ...
1
vote
1answer
56 views

Creating charging particles using Shuriken

I've been trying to create a charging effect using the Shuriken Particle system for the longest time, and I've had little to no luck with it. I've tried setting different curves for the Force over ...
1
vote
1answer
59 views

How can I calculate the visible area of my camera in world space and take zoom into account?

I am trying to get the bounds from an orthographic camera in Unity which take into account the current orthographic size (zoom). I thought that I could use the cameraToWorldMatrix to transform the ...
1
vote
2answers
84 views

How can I do something only after an animation has finished?

I'm making this 2D platform based game. Basically what I want is when the player walks into spikes (which have a "deadly" tag") it displays the animation that has the parameter of animate with the ...
0
votes
1answer
125 views

How to calculate FPS and what factors affect FPS?

In this case, FPS means Frames Per Second and that means the number of frames that graphic hardware render in one second. I'm wondering what kind of stuffs could affect FPS? So, for some tests I ...
0
votes
1answer
40 views

Destroying the instance that instantiated the prefab

What I have so far: A fuel that has Fuel script attached to it. The fuel prefab is first instantiated from another script in its Start() method. problem: The Fuel script is such that it results in ...
0
votes
1answer
44 views

The object of type GameObject has been destroyed but you are still trying to access it

I am instantiating the prefabs time to time and I want them to be destroyed with in 2 to seconds as well. But I am getting the error that says: The object of type GameObject has been destroyed but ...
0
votes
1answer
28 views

Creating a prefab

Problem: The prefab script is never executed. What I did: Created a GameObject Created a prefab Dragged GameObject over the prefab Deleted the GameObject from Scene Added the prefab script to ...
-1
votes
0answers
20 views

Instanting prefab in a random place and move it along the road

I have a track that is moving to give the effect that the player is moving. Now I want to have a fuel tank which happens to show up at random positions on the track. What I tried so far just sticks to ...
-1
votes
0answers
40 views

Volumetric Clouds in Unity

How would I go about creating volumetric clouds in unity?
0
votes
1answer
53 views

Unity create water issue

I use daylight water in my project but by the default it has not got any waves or light tracing effects. But in some tutorials I see how the user add standard water asset and it has got beautiful ...
3
votes
1answer
57 views

Unity: White line at camera meaning

I'm a new comer to Unity. In Unity, when I click to main camera in Hierarchy view. I see 6 lines: one blue, one red, one green and three white. I know red/green/white lines for (x,y,z) location but I ...
-4
votes
1answer
74 views

Which programming languages can I use with Unity?

I am fairly familiar with Unity and I know how to work most of the features within it. But I don't know what programing languages to use for my Unity game. I have heard that it might be C#, but I am ...
2
votes
1answer
102 views

Implementing Galaga Style Enemy Behavior in Unity

I've been trying to work on a space shooter with the idea of having enemies behaving like it is shown in this video : https://www.youtube.com/watch?v=3p7u8uCR6yw In the video above, enemies fly from ...
0
votes
1answer
64 views

Unity Physics Material - Character Slides Too Much

I am currently working on a 2D platformer in Unity. I am using a prefab from the AssetStore for my character (The last paragraph contains a link to the prefab). The character has a circle collider for ...
0
votes
1answer
27 views

How do I properly import an fbx 3D model into Unity3D?

I am trying to properly import a 3D model that was made for my game in Unity3D. I was able to import the model, and I put the texture on it, but there are several other files that go unused. I think ...
3
votes
1answer
237 views

Rotating a GUI.Label relatively

Learning Unity for 2D development, I want to create a text label. So far, I have been using GUI.Label to write the text. It is above my sprite: I would like to rotate the label relatively to the ...
0
votes
1answer
32 views

Decentralized Matchmaking in Unity?

I'm making a card-playing game, similar to Magic Workstation. I've been looking into several options for networking. I have a working LAN version with the build in Unity networking, as well as Photon ...
0
votes
3answers
89 views

Minecraft Type Game Support Blocks

OK I have a game that is similar to minecraft in a sense. Players can build castles block by block. I'm using Unity3D and Photon Network for my game and I was wondering how I would handle detecting if ...
0
votes
1answer
84 views

Unity 2D, C# - Make object move diagonally by a certain angle?

I have a sprite object which I want to move in 8 directions. Left, Right, Up, Down, Left top, Right top, Left down, Right down. The view is 2D with a isometric projection. The difficulties I am ...
0
votes
2answers
90 views

How to give a Jerk Effect when the player is moving left of right

float amttomove = Input.GetAxis("Horizontal") * playerspeed * Time.deltaTime; transform.Translate (Vector3.right * amttomove); Currently, I have above script in Update function to move ...
-1
votes
1answer
36 views

Moving an object continuously when left or right key is pressed

I want the object to move continuously as long as key is pressed to left when left arrow is pressed and to right when right arrow is pressed. Instead of moving continuously it moves first time and ...
0
votes
1answer
33 views

Incosistent jump, stuttering

I've written this C# code to handle movement in my testing project. The game is supposed to be 2D, some kind of a platformer, just to get me started with Unity. However, it seems there's something odd ...
0
votes
1answer
62 views

Working with retina graphics on Unity 2D

I begun trying Unity for iOS 2D development. I am curious about how to work with retina devices. The first thing I did was create a 1136x640 solid rectangle sprite and throw it into my scene, then ...
1
vote
0answers
65 views

How to use an A* Pathfinding System across uneven environments?

I am developing a game in Unity3D. I want an enemy character to follow the player around. The problem is, my surface is uneven and full of mountains. I am using aarongranberg's pathfinding project. ...
-1
votes
2answers
77 views

how would I go on about making a movement system like mario party

main question how would i go about getting a movement system similar to the one they have on mario party only minus the dice roll things i have researched so I have been studying the uses for ...
0
votes
2answers
34 views

Monobehaviour can not find a member OfType in Unity

This is the line where I am getting above mentioned error: var listeners = FindObjectOfType<MonoBehaviour> ().OfType<iPlayerRespawnListener> (); I have already imported these libraries ...
1
vote
0answers
39 views

How to make a text of several letters animate, only with an animation

I wonder if it is possible to create an animation in a text with a single "animation". The problem is that for me to reach the desired effect I need to create an animation for each letter, as each one ...
0
votes
2answers
199 views

Is it possible to use C++ with Unity instead of C#?

The title kind of says it all. Is it possible to replace C# with C++ on a game using Unity?
1
vote
0answers
48 views

Unity Animator State Freezing

I am really new with Unity, I am making a game, but I am having some problems with the animators, my problem is that I am trying to add some animations to my menu, and also add new characters to my ...
0
votes
0answers
33 views

Text within a gameObject boundries

I am working in a little project and I want to show text within a rectangle. for that I use a sprite(rectangle) and a child that contains a TextMesh as component. The text change during runtime, and ...
-1
votes
2answers
103 views

Does Unity have a built in pathfinding system?

I know that there a lot of plugins available for pathfinding in unity but I was just wondering if unity has a built in pathfinding system ?
1
vote
3answers
155 views

How to create sprites, programatically without using prefabs?

I have different types of images for different sprites. and i am not certain that how much different sprites(images) i will have to show. So, i gotta create the sprites and apply textures ...
0
votes
1answer
128 views

What is the best type of c# timer to use with a Unity game that uses many timers simultaneously?

I am developing a stand-alone 3d game in Unity that will have anywhere from 1 to 200 timers running simultaneously. There will be a GameObject containing 1 timer. For this game timer durations will ...
2
votes
2answers
312 views

Keypress Left is called twice in Update when key is pressed only once

I have a piece of code that is changing the position of player when left key is pressed. It is inside of Update() function. I know, Update is called multiple times, but since I have an ifstatement to ...