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
1answer
81 views

Usage of math.Atan2 in a 3D coordinate system with Unity

I have a simple question on usage of math.Atan2 function with Unity in a 3D environment. I found this code on Unity's documentation for Math.Atan2. I changed it a bit to fit my needs. Vector3 ...
1
vote
1answer
61 views

Objects don't instantiate at mouse position

I'm trying to get the player to shoot a projectile at the mouse position, however the projectile is shot in weird directions (http://gfycat.com/BothFluidHoneyeater). Here is relevant part of my ...
0
votes
2answers
82 views

animation control problem

I have a list of .FBX object.When I drag that .FBX into scene its corresponding inspector Animation component(fig 1) appears but when I drag some other .FBX object into the scene the Animator ...
-3
votes
1answer
120 views

Game Lagging due to too much details [closed]

I'm making a car racing game where you drive around hills. The game has some performance issues. At some point it starts lagging badly. After one day spent on this, I realized that when the car ...
1
vote
1answer
53 views

Wandering motion in Unity

I am trying to come up with a smooth wandering motion for my game-object using Unity. What I currently doing is rotate the object by some random angle calculated every 1.5 second delay. But I am ...
5
votes
1answer
476 views

Unity3D - How to tessellate 2D sprites?

I use dynamic vertex lighting on 2D sprites. On larger sprites the lighting is uglier than on smaller ones. This is because every sprite is just a quad of two triangles. Not enough vertices there for ...
0
votes
0answers
38 views

Is there a way to use a plugin with the free version of the Unity3D editor on OSX?

I'm making a plugin for Unity3d. On windows you build a .dll and put it in Assets/Plugins. This is only supposed to work with the pro version of unity but you can get it to work with the free version ...
0
votes
1answer
119 views

Why are my target-following objects rotated the wrong way?

I writing a script that would make my players reach a target destination. It looks like this so far: private void MoveTowardsGoal() { if (Vector3.Distance (reachGoalTarget.transform.position, ...
0
votes
1answer
43 views

Shared Material

I have this simple script, so the user touch one of the cubes all cubes with same material will change color. One of this cubes must have the name of the color on it, only one, so the user touch the ...
1
vote
2answers
87 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
125 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
90 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
147 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
42 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
28 views

Align SpriteText position

i have this function which aligns text. static function AlignTxt(obj : GameObject, txtAnchor : SpriteText.Anchor_Pos, txtAlign : SpriteText.Alignment_Type) { ...
2
votes
1answer
2k 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
67 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
116 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
55 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
75 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
91 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, ...
6
votes
0answers
162 views

Unity: Why do my normals flip during an animation?

This problem boggles my mind. I have an animation running on a face object (imported from Blender). At a few points in the animation, the normals switch direction! It causes the mesh to blink. Of ...
1
vote
2answers
354 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 ...
2
votes
1answer
39 views

How can I display Unity games in Flex?

We have tried the following methods to upload sample Unity3D build to a desktop application in Flex: HTML Loader, NavigateToURL, iFrame and resolvePath. But we only see the text content, not the 3D ...
-2
votes
1answer
56 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
69 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
95 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
139 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
152 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
43 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
84 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
36 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 ...
0
votes
1answer
57 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
66 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
81 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
141 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
128 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
35 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
258 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
63 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
102 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
275 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
98 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
58 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
50 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
87 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
74 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
93 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
41 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
45 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 ...