Questions tagged [unity]

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.

Filter by
Sorted by
Tagged with
9
votes
2answers
519 views

How to avoid spaghetti in the animator?

I am working with animations in Unity and so far I have made only four (Up Down Left and Right) and my animation window looks following... Problem is that if I was moving Up I want hero to stay ...
9
votes
2answers
33k views

How to detect mouse over for UI image in Unity 5?

I have an image that I have setup to move around and zoom in and out from. The trouble is the zoom can be done from anywhere in the scene, but I only want it to zoom when the mouse is hovering over ...
9
votes
2answers
567 views

Why doesn't light continuous on my model?

I created a basic textured cube model with Blender to practice modeling, and then I imported it into Unity. After I put up some lighting it looks pretty ugly. The light is not continuous on a row of ...
9
votes
3answers
5k views

NullReferenceException in Unity

Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea ...
9
votes
3answers
3k views

How can I launch a GameObject at a target if I am given everything except for its launch angle?

I am trying to launch an object at a target, given its position, its target position, the launch speed, and the gravity. I am following this formula from Wikipedia: $$ \theta = arctan \bigg( \frac{v^...
9
votes
3answers
550 views

Slerping rotation mirrors

I rotate my game character to watch at the target using the following code: ...
9
votes
2answers
29k views

Resolution problems when porting a Unity game to Android

So, I'm porting a game to the Android for the first time in Unity3D. And I've run in to a few problems along the way. My current problem is the resolution doesn't seem to be right, it cuts off the ...
9
votes
1answer
4k views

How can I record from a second in-game camera and later export it to a video file?

I'm making a PC Horror game in Unity, and I want to have a camera recording simulation in-game - so you can leave a creepy location anytime, and you will have a tape with what you recorded on camera ...
9
votes
2answers
5k views

How well does Unity 3d work for both Android and iPhone?

First off this question might be a bit broad so I apologize if it is. I am really just looking for peoples experiences and personal knowledge on the subject. I am looking to create a game for both ...
9
votes
1answer
8k views

How to create high quality and fast portal effect?

EDIT: So I've gotten the portal visual effect working with no performance hit, and I've got the physics set up of objects with rigidbodies moving through portals seamlessly, and objects with character ...
9
votes
5answers
29k views

How to create a new GameObject, without adding it to the scene?

I'm creating what is essentially my own prefab system. Game objects are defined by a human readable data file. I'd like to create an empty GameObject, load it with the components defined in the data ...
9
votes
1answer
1k views

Building an Octree for terrain generation

I've previously implemented marching cubes/tetrahedra to render an IsoSurface. It worked (YouTube), but the performance was dire as I never got around to implementing variable Level of Detail based on ...
9
votes
1answer
845 views

How do I manually draw a part of a sprite sheet?

I'm working in Unity, and I'm finding that the animator isn't working for what I'm trying to do, in my 2D game. I want to build a specific animation, using sprite sheets, and be able to reuse the ...
9
votes
1answer
2k views

2D Water top surface profile

I am trying to create the effect of the water surface thickness with a vertex-fragment shader. I am in a 3D game environment but It's a scroll view so a "2D" view. Here is a good tutorial of creating ...
9
votes
1answer
2k views

How to occlude lights in Unity3D?

First off, I own Unity Pro. I've been looking in to occluding lights when they aren't being viewed for a while now to improve performance. The main methods I ran in to were using BecameVisible() and ...
9
votes
2answers
16k views

How do I make my character slide down high-angled slopes?

I am currently working on my character's movement in Unity3D. I managed to make him move relatively to the mouse cursor. I set a slope limit of 45°, which does not allow the character to walk up the ...
8
votes
4answers
5k views

Mechanics to keep mobs and environment alive without using tons of memory?

I'm working on a server for a little mobile MMORPG. This consists mainly of two important features: mobs and environment resources like trees, rocks etc. The world is randomly generated and each time ...
8
votes
2answers
1k views

Unity 3d 4 players Only 4 buttons can be pressed at a time

Only 4 buttons can be pressed at a time, so players cant move sometimes Each Player Has their own Controls i Change, Up Arrow and the other ones for each player---v InputsV-V-V ...
8
votes
6answers
3k views

Why am I not getting stuck in the loop

I'm new to Unity. I was learning coroutines and I wrote this. ...
8
votes
3answers
9k views

How to synchronize a game with music

You may be familiar with ryhtm games as Dancing Line, Geometry Dash, or even Guitar Hero. They have something in common : every single action in the game is synchronized with the music. My purpose is ...
8
votes
2answers
3k views

Constant 2D Bullet movement in a shmup

I've been following the pixelnest tutorial to make a 2D shmup (http://pixelnest.io/tutorials/2d-game-unity/player-and-enemies/). While working on this I've experimented with increasing the firing ...
8
votes
1answer
33k views

Unity 5 2D drawing sprites programmatically

How can I draw sprites in Unity 5 programmatically ? I am looking for something similar to spriteBatch.Draw() in XNA. The results I get when I search about it are ...
8
votes
1answer
1k views

Is it wrong to be creating new objects in Update()?

I'm using Unity and sometimes I'm using th new keyword in Update, like new Vector3() etc... ...
8
votes
3answers
20k views

How to dynamically create an UI text Object in Unity 5?

I have been searching for something that should be simple, but Unity 5's documentation on that is fairly outdated. What I want to achieve is to be able to create UI Text totally from script, i.e. ...
8
votes
3answers
991 views

How can I keep two racing players synchronised?

I am working on a Unity mobile game, much like a multiplayer version of Temple Run. I'm seeing a fluctuating network latency (generally 200-500ms) because of the mobile platform. The two player ...
8
votes
2answers
7k views

Where and how to check if game was developed with bought Unity3D licence (not cracked app)?

We hired an external team from Eastern country. They built our mobile game app using Unity3d which we paid a lot of $K. We asked them to only use the software with bought license, not cracked one, and ...
8
votes
2answers
6k views

Why does Unity3D crash in VirtualBox?

I'm running Unity3D in a virtual instance of Windows, using the Virtual Box software on Linux. I have guest additions installed with DirectX support. I've tried using Windows XP SP3 32-bit, and ...
8
votes
4answers
2k views

Which for basic RTS prototype: Unity or Torque? [closed]

I'm wanting to test my hand at writing an RTS (something I've never gotten very far with), and so I'm looking for an indie engine that would give me the most success with a quick setup that I can then ...
8
votes
3answers
958 views

Can a Game Engine be built into a Game Engine?

This confuses me as the title says "Mostly Civilized: A Hex-Based 4x Game Engine for Unity - Part 1" Unity is a Game Engine, and he is building a game engine for a game engine. Did he word this ...
8
votes
2answers
744 views

How to create a 2D physics waterfall

I am trying to create a waterfall that looks similar to the first image below (please check this video for a better idea of what I want to achieve) with physics properties so it can move or around ...
8
votes
3answers
4k views

Overcoming float limitations for planet-sized worlds in Unity

As far as I know, going further than 1M units from the world origin in Unity is hardly possible due to floating point precision issues. Making a world more than 1M units in radius would require ...
8
votes
1answer
2k views

Moving texture according to position in shader

Divinity Original Sin have beautiful particle effect , When I move around game I see galaxy through particle that move according to my position.how can I make like it? you can see this effect here: ...
8
votes
2answers
3k views

Why is the for loop more efficient than the for each loop in Unity?

During a Unity talk about performance, the guy told us to avoid for each loop to increase performance and use the normal for loop instead. What's the difference ...
8
votes
1answer
13k views

Understanding pixel art in Unity 2d

I am struggling to understand the basics behind pixel art in Unity. I understand what a unit is, and that if I draw my sprite with 16x16 pixels, I should set PPU to 16. Take stardew valley for ...
8
votes
4answers
3k views

Infinite 3D Cave in Unity

A friend and I are hoping to make a game in Unity in which you fly through an infinite 3D cave that can twist and wind in any direction (though obviously not to the point that the turns are impossible ...
8
votes
2answers
8k views

Pointers in C# Unity

Hey I've just learned about pointers recently and am wondering how I can use them in c# (I just learned about them in c++) in unity. I do have some questions though. Pointers use low level ...
8
votes
5answers
11k views

What is the logic behind the 'Loading' scenes in games?

I'm making my first game, it's a tower defense type of game, using Unity game engine and taking Fieldrunners as a reference. I would like to know more about the functionality behind 'Loading' scenes ...
8
votes
4answers
2k views

Is it “wrong” to build Unity games entirely with UI elements VS sprites?

I find myself coming on board a Unity project with an outsourced programming team. Our mobile game has a number of minigames and they have built them entirely out of UI elemetents, or raw images on ...
8
votes
3answers
5k views

Networking and movement in MMORPG's UNITY

I'm programming a dedicated server in C# using BeamServer2 DLL's. At first I wanted to be able to see other players move on our already made Omuni map. This I did by just sending your position to the ...
8
votes
2answers
10k views

shader tutorial for unity [closed]

I would like to start developing my own shaders within unity. For starters I would like to do a screen spaced blur. Are there any good tutorials to learn shader development besides the official ...
8
votes
1answer
28k views

Draw circle around gameobject to indicate radius

I have a tower in my tower defense game im making with an upgradable radius and i would like when the user clicks the tower to show the radius as a circle around the tower My original thought was to ...
8
votes
1answer
2k 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 ...
8
votes
1answer
4k views

Mip Maps on 2D Sprite causing black line above. Why is this?

I am new to Unity. I'm trying it out and using Futile for a code-first approach, but still importing textures using the Unity system. The problem I'm having is that when I use mip maps to scale large ...
8
votes
1answer
15k views

Angle between two points

I have a character who walks to random points in my room in Unity. The problem is he always faces one direction, I want to write in C# a piece of code that will get the direction the character is ...
8
votes
1answer
2k views

Unity Hybrid ECS with “old way”

Is it possible to use Hybrid ECS with some components and the standard MonoBehaviour with all your old code? I want to know because I already have some game ...
8
votes
1answer
6k views

Unity: Apply an Image Effect on one layer only

Please consider this simple scene. It’s composed of 3 different game objects. 1 background image + 1 static character image + 1 small part (with the pet) that is changed at runtime to perform an ...
8
votes
3answers
2k views

Flash, Java, Unity plugin install penetration?

Is there data on how many users have Flash, Java, or Unity plugins installed?
8
votes
1answer
2k views

Snapping shapes together in game

I'm trying to work out how to snap shapes together the player may move around on a canvas. As the square approaches the other object, I want to pull that shape in (given a certain proximity) and have ...
8
votes
3answers
6k views

Why does Unity in 2d mode employ scaling and the default othographic size the way it does?

I previously used SFML, XNA, Monogame, etc. to create 2d games, where if I display a 100px sprite on the screen, it will take up 100px. If I use 128px tiles to create a background, the first tile will ...
8
votes
2answers
3k views

How does Unity3D lower an imported .obj vertex count?

I have a question regarding how Unity3D handles importing of .obj files. I'm importing this teapot: http://groups.csail.mit.edu/graphics/classes/6.837/F03/models/teapot.obj The number of vertices ...