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)

0
votes
0answers
4 views

Collsion on place without collider

I'm creating a simple endless runner game, I'm dynamically generating the terrain, I'm placing obstacles at runtime at pseudo-random position. Here is the script that generates the terrain and places ...
0
votes
0answers
27 views

Unity - 2D - My Sprite “hovers” over the ground

When my "main player" falls onto a platform, it seems to hover a couple pixels above it. Why is this so? I show you 2 images, one with the hero selected in the hierarchy, and another with the ...
0
votes
0answers
15 views

Stitching terrain tiles made in Blender at runtime

Background I'm making several individual terrain tiles inside of blender for use within a Unity 3D 5 game. Each tile is square and is made to represent a segment of a world. In game the tiles are ...
2
votes
2answers
20 views

How to instantiate a sprite from a sprite sheet using script in unity?

We are creating a 2D top down rpg, and we have multiple textures, and we need to be able to change which sprite sheet its reading from in order to change the look of the walls and floor in each room. ...
0
votes
1answer
44 views

Generate random position within object

I have an plate object which is generated somehow(don't care how), now I want to put another object within this object on random position. Lets say that I want to put random trees on this plate. How ...
2
votes
1answer
36 views

Getting the Volume of an Uneven Mesh

Let's say I have a cube, and that cube breaks apart into 100 different unevenly sized pieces. How can I get the volume of each of those pieces compared to the cube's volume? Using this in order to ...
3
votes
1answer
57 views

Unity - Water Cube (to 2D game)

I wonder if you can create a cube of water within the unity! I'm starting to use the Unity, and took a sought as to whether there was already something like this ... but have not found any tutorial ...
-1
votes
0answers
26 views

Getting size of Unity3D scene (bounding box)

I have following problem. I need to get bounding box of Unity3D scene in order to both making it impossible for character to fall endlessly if he happens to get out of the scene, and to calculate AI. ...
1
vote
1answer
40 views

How to Slice the external Spritesheet programmatically by using C# in Unity

I have a sprite sheet like this: I am using Unity Engine to develope my game. I would like to load this external spritesheet outside and slice it as Grid type programmatically instead of using ...
1
vote
3answers
108 views

AI Random Path Genenrating

I would like to make an enemy walk randomly around a map I have made and if the player is in his zone of sight the enemy to change state to attacking/following. So how would I accomplish something ...
-2
votes
1answer
48 views

How can I make a gameObject “stick” to another gameObject after it has collided with it?

How can I make a gameObject "stick" to another gameObject after it has collided with it? Right now the gameObject just passes through! [C#]
0
votes
2answers
45 views

Unity - Determine direction vector3 from a point in space and an angle in eulers

I have a ball positioned as Vector3(x, x, x). I was able to get the direction of the ball to the mouse clicked position with: Code (csharp): Vector3 direction = Direction (clickPos2 - startPos); ...
0
votes
1answer
18 views

Unity Application.LoadLevel freezes the game on Android device

I'm developing a game using Unity. The game has a single level and after the player wins/loses, I simply want to reload the same scene. Here's the code I'm using: private void OnLevelFailed() { ...
0
votes
1answer
29 views

Is there anyway I can make a plane visible from both sides?

In Unity i have a model of a tree with leaves made of a plane and a texture, when I upload it to unity the texture is only visible on one side so how can I change it to be visible from both sides ...
0
votes
0answers
14 views

Use Lerp Position and Slerp Rotation together

This is what I try to do, When I click on a UI Element, the camera smoothly rotate (to look at the target) and simultaneously move on top of the target. To perform that I use a two Coroutine one for ...
0
votes
2answers
13 views

unity - get component variable from object in trigger

i want to get a component value from the game object which collides with my trigger's object script. this is my code on the trigger: void OnTriggerEnter (Collider obj){ ...
0
votes
2answers
26 views

WorldToGUIPoint seems always off by about 2 pixels

I'm trying to draw small boxes at each vertex of a mesh, in the editor. My OnSceneGUI code looks like this: foreach (Vector3 vertex in _mesh.vertices) { Vector3 worldVertex = ...
0
votes
0answers
16 views

Google Cardboard Application is not Running on moto G 2nd generation mobile

I am working on the Google cardboard application, here i am using the unity to develop the cardboard app. I have tested the application in moto g 2nd generation here application is not running smooth, ...
0
votes
1answer
33 views

How to set up the camera for a PS Vita game?

I am starting my first project for Unity and I want to start a new game for PS Vita. This console has a resolution of 960x544 pixels. How do I have to set up my camera so that it adapts to this ...
0
votes
1answer
70 views

How to create 2D shadows and lightning?

How do I create shadows and lights in a 2D top down perspective game? I want to achieve an effect similar to this game (also made in unity) where some objects like a torch, different sprites and the ...
0
votes
0answers
23 views

Unity 5 Networking Send Rate: Send Rate is Zero but server movement is still happening

I have a client server scenario, just a player moving about on the client and he moves about on the server using the built in networking provided in Unity 5. I have my client scene running in the ...
0
votes
1answer
25 views

Can I export a model and texture from a terrain file built in Unity3D?

I am mostly familiar with building my level maps within unity, and have become quite use to its inbuilt terrain creator, in both generating my terrain, and spraying a texture on to it. I am making a ...
0
votes
0answers
30 views

Set Render Target usage

I am using Unity and I have some difficulties about understanding the way Set Render Target works and how it can behave with the shaders. Is it possible to render a shader pass in multiple render ...
0
votes
0answers
8 views

Display Google play service profile Image in Unity [on hold]

I need help displaying a logged in user's profile image using google play service plugin for unity.
1
vote
2answers
47 views

How to display a list of 2D arrays in the inspector

Simply put, how do I make public List<bool[,]> appear in the inspector? Every 'bool[,]' is a solution to a puzzle in my game and I want to be able to view and edit them in the inspector.
0
votes
1answer
32 views

Determine facing direction mecanim 2d movement

I'm using this script to move my character in my 2d world: public float speed; //Movementspeed public Rigidbody2D rbody; Animator anim; void Start () { rbody = ...
1
vote
0answers
20 views

The animation state could not be played because it couldn't be found!

If I try to use animation.Play() or have Play automatically ticked in the inspector on the animtion object, it gives me the follwing error: The animation state could not be played because it couldn't ...
1
vote
1answer
35 views

Unintentional slight arm position change

In the scene I have a capsule with a camera parented and a looking script so when I look down or up the weapon slightly moves forward and then moves back when I look straight forward. weapon when I ...
0
votes
1answer
24 views

Animation impulse system?

I'm working on an animation system for an RTS game. Each unit has several animation states: Move, Idle, Engaging, etc.. Units also have a variety of "Animation Impulses" which are animations that get ...
0
votes
1answer
28 views

Changing long float to number + short scale

I am looking to use a piece of code to take an extremely long number and convert it to decimal equivalent + short scale. (i.e. 120100000000 would be 120.1 Billion) I am doing this with two separate ...
4
votes
2answers
161 views

What format should I choose? [on hold]

I am making models in blender to export them then in unity, and unity can import .blend formats as well as .fbx, so which one is better, is there even any difference.
0
votes
1answer
22 views

Delete EdgeCollider issue

In this program, When i draw a hill, a car can road on it's surface, and when I draw another one, the previous hill should remove. but unfortunately the previous edge collider looks still there. ...
0
votes
1answer
14 views

problems with imported texture

I have done a texture in GIMP and imported it in Unity but for some reason the texture appears to be squashed in the sides. Image done in gimp: And here is what happens in Unity:
1
vote
2answers
66 views

How can I make a gameObject jump quick at first then start slowing down after a while?

How can I make a gameObject jump quick at first then start slowing down after a while? It definitely has something to do with deltaTime.
1
vote
1answer
63 views

Find alternate shortest paths in Unity

I'm developing a game in Unity. It's a simple game where the rocket has to reach the point where the player touches on the screen. The movement of the rocket is physics based. When the rocket goes off ...
-2
votes
0answers
27 views

Can someone translate the comments in this script to proper code? [closed]

Can someone translate the comments in this script to proper code? I want to detect a long press on a touch screen then activate an animation. When the finger is released, play another animation ...
0
votes
1answer
25 views

Unity tiles with wierd border flickering when moving horizontal 2D

I recently made some Tiles using a program called Pyxel Edit to create some placeholder graphics. The problem I'm having is that when I move the camera horizontal the edge of the tiles starts to ...
0
votes
1answer
30 views

How can I detect a long press then activate an animation?

How can I detect a long press on a touch screen then activate an animation? And when the finger is released, play another animation smoothly? Let's take for example the main character in Crossy Road: ...
1
vote
2answers
35 views

Create a 2D trail in Unity?

I would like to make a trail for a pixelated snake such as this one : As you can see, the cross simply repeats itself to create the snake. In Unity I have messed around with Trail Renderer, tried ...
0
votes
0answers
16 views

invaliduriexception with photon unity

I am using photon unity networking right now to make a multiplayer game. When I publish to windows the build works fine, but when I change unitys build settings from windows to webgl it gives my a ...
0
votes
0answers
15 views

Is there a reason to create custom input for character controller in unity? [closed]

Is there a reason why I shouldn't use the cross platform inputs which comes with Unity( the ones in assets->import package Cross platform input). Some people told me that I shouldn't use them and ...
2
votes
1answer
75 views

How to remove a component of an object in a script?

I want to remove a Sphere Mesh Renderer component from a certain gameobject. I want to do this in a script. How do I do it? I do not want to destroy the sphere itself, just the component
0
votes
1answer
20 views

(Unity) Drag and detect object below when dropping

I'm studying game development in Unity and I want to create a idle/clicker game like Cow Evolution. I'm using OnMouseDown, OnMouseDrag and OnMouseUp to move the GameObject around the scene. Now I ...
0
votes
1answer
46 views

How to achieve a for loop without Unity crashing?

I want to make a for statement that repeats constantly until a stop variable becomes "1". But wherever you type a "for" statement in any way or even without anything in the statement, Unity just ...
5
votes
1answer
59 views

How can shader code duplication be reduced in Unity?

In our current Unity project we have a few shaders that are basically just supersets of another shader. For example, we have a shader that performs lighting calculates with diffuse, normal, specular, ...
0
votes
1answer
16 views

How to check if an GameObject exists in Unity2D? (Javascript)

Im making an AI that checks if the player exists or not. How do I check if a certain object exists and put it in a boolean variable?
1
vote
1answer
50 views

Restricting body movement withing a specific length while dragging a gameobject in unity

private void OnMouseDrag() { Vector3 screen_sp=new Vector3(Input.mousePosition.x,Input.mousePosition.y,screen_space.z); Vector3 cur_pos=Camera.main.ScreenToWorldPoint(screen_sp)+offset; ...
1
vote
1answer
19 views

How to revert to MonoDevelop's old “ctrl-tab” behavior? [closed]

I believe MonoDevelop (bundled with Unity3D) has changed its ctrl-tab and ctrl-shift-tab behavior and I would like to get back to the old behavior, as the new way frustrates my workflow. Ctrl-tab ...
1
vote
2answers
30 views

Proper way to handle Movement/Animation/AI functions of an AI character in Unity3D

My team is currently building a 2D game in Unity and we've run into some workflow/script organization blockades for many of our game's characters. For example, we're not sure what the standard method ...
0
votes
1answer
18 views

Unity: “Find” can only be called from the main thread, but moving variables to the Start() function causes other errors

#pragma strict var collided = false; var thrust: float; var pizza = GameObject.Find("pizza-small").GetComponent.<Rigidbody2D>(); function Start() { } //hand + pizza ...