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
votes
0answers
35 views

Animation is not playing [closed]

Some animation cannot be applied on the character.This the code I have used to play a animation on the character.Can anybody help me solving this issue? void OnMouseEnter() { Debug.Log ...
0
votes
1answer
39 views

Downloading 10 images and storing their data with WWW

I would like to download 10 images, and store their texture data into my list. I don't really know how to do that - I heard that for this you use the WWW class, so I went: List<byte[]> ...
1
vote
1answer
52 views

Why are shadows not snapping to the objects?

I'm using a directional light in Unity to cast shadows. However, the shadows don't appear to be "snapped" to the objects creating them. The object appears to be floating in mid air while it actually ...
-2
votes
0answers
33 views

How to create Timed Mode in Unity

I am creating a 3d Road rash kind of game in unity. My player(bike) does not move in z axis but the track and enemies are moving towards it and hence make it appear to move. I can already calculate ...
-3
votes
0answers
58 views

Getting the bike on first wheel [closed]

I am working on a unity3d game. I have been trying to figure out which function do I need to use to get the bike on its first wheel momentarily.Any help on that, please? Like real world, when it ...
-2
votes
2answers
79 views

How to increase speed of GameObject? [closed]

I'm making pong game in unity3d with monodevelop(c#). I want to increase speed of ball when it touch ends of paddle corner. my ball script: using UnityEngine; using System.Collections; public class ...
8
votes
1answer
578 views

Why is my custom Texture2D blurry?

Have some WWW object downloading a .PNG image. ((SpriteRenderer)renderer).sprite = Sprite.Create(request.texture, new Rect(0,0,100,100)); My sprite looks fine. Now, let's be a bit ...
1
vote
0answers
20 views

Can I create a Sprite Asset using a downloaded Texture at runtime?

I know that Asset Bundles exist, and I'm already taking a look at them. But I'm still interested in this particular approach: I am interested in downloading a .png image from the Web, and then ...
1
vote
1answer
76 views

How to make prefabs independent?

I'm working on a Unity's Project and I want to modify a prefab, more precisely I want to change the texture of a prefab. The problem is that my modification is applied also to other prefabs. I read on ...
3
votes
2answers
151 views

Where/how do I store configuration files in Unity development?

I am transitioning from working with cocos2d-iphone to Unity. One particular thing I loved were the .plist files: you could easily put any sort of configuration data you wanted: for game levels, ...
2
votes
2answers
49 views

How to unpause a particular gameobject in unity?

Say, I have a GUI Menu attached in a game scene. The game will be in pause state by default. I did it by setting "Time.timescale=0.0f"; I want my game to unpause only when Play button clicked. My ...
2
votes
1answer
31 views

How can I add a batch of sprites to a list in Unity's inspector?

I have a C# script with a public property: List<Sprite> someSprites; I would like to add 20 sprites to it, from the inspector window. However, it seems like the only way to do so is to drag ...
1
vote
2answers
102 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
93 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
2answers
44 views

Changing distance after some time on OnGUI Unity

Though I am using IEnumerator to calculate the distance travelled value, the distance is updated very frequently, how can I change that? and why exactly increasing the time in WaitForSeconds function ...
1
vote
1answer
82 views

How to rotate object not from it's center point but from it's another point?

I am new in unity and I am developing a game where I want to rotate my object I try this code for it. if(Input.GetMouseButton(0)){ if(Input.GetMouseButtonDown(0)){ ...
3
votes
2answers
165 views

What is the pixels to units property in Unity sprites used for?

I'm starting to learn Unity for 2D development. So, I am importing several sprites into the game, and I couldn't help but notice that there is a "pixels to units" property, by default on 100. I ...
0
votes
1answer
47 views

Terrain (mesh) textures in Unity - blurry?

I've created a 3D mesh in blender which will be used as a terrain in Unity. Additionaly, I created a 900x900 texture which I'd like to apply as material to the mesh. However, unlike with the normal ...
1
vote
1answer
58 views

Correct multiplication order for a 2D Matrix

I'm currently trying to create a camera and entity/model matrix for my 2D game similar to that of Unity3D. I've already tried to find answers to this question on stackoverflow/gamedev but i couldn't ...
0
votes
0answers
17 views

calculating avoidance forces for similar objects unity [duplicate]

I am trying to work on collision avoidance for my troops. Currently all my troops have their target object as the leader who is wandering in physical space. The troops just follow the leader but they ...
1
vote
0answers
33 views

Unity Free Inverse Depth Mask?

How would it be possible to create an inverse depth mask? In this case, I refer to a depth mask as a shader attached to a mesh that 'pokes a hole' through the current camera layer to let you see the ...
0
votes
0answers
17 views

Gameobject sprite size wrt NGUI sizes

I'm working on a project that targets mobile platforms. I'm facing problem with asset sizes. I set the UIRoot as fixed with manual height of 1080. Next, i imported a simple black square (500x500) and ...
0
votes
1answer
53 views

Moving gameobject with animation according to my script Unity3D

I am developing a game with Unity3D with an horizontal list of elements which you can move with arrows. Here you can see an example: I have created animations in order to modify the alpha value of ...
0
votes
1answer
41 views

Move camera from wherever camera is to pinned point

So, I need to switch/ move/ animate camera from point X (not point A,as I don't know where the camera is at that momemnt) to point B (place where you want your camera to move). This is for ...
0
votes
1answer
71 views

How can I make an object change direction?

I have a moving cube that, when it moves over an arrow, should change its direction to the direction of that arrow. What would I need to do in order to accomplish this?
0
votes
0answers
32 views

Unity - 2D - Scaling to fit between two objects

The game is a top down 2d shooter and I'm facing trouble in doing this : - I got a player 2D ship - The player fires laser, which is a long thin image with box collider attached. - What I want is that ...
1
vote
1answer
46 views

Pause on scrolling backgrounds

I have a typical parallax backgrounds. They are scrolling by public float Speed=0f; void Update () { renderer.material.mainTextureOffset = new Vector2 (Time.time*Speed,0); } I have a ...
0
votes
1answer
62 views

How to show NGUI menu in the upper of a Game Scene?

I am new to Game Development. I made a menu with NGUI plugin. I have a background image in the behind of this menu. Now, I want to place my Game Scene in place of the background image. I have tried in ...
1
vote
1answer
57 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
52 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
73 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
112 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
49 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
424 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
30 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
78 views

Moving object towards a target Unity

I am trying to implement a script where basically my players would reach the target destination. Below is my script private void MoveTowardsGoal(){ if (Vector3.Distance ...
0
votes
1answer
40 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
66 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
65 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
86 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
104 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
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
vote
1answer
814 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
56 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
96 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
43 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
74 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
57 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, ...
5
votes
0answers
109 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 ...