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

GameObject is only rendered when it has a negative z scale

I have an orthographic camera that looks like this: I create 2d polygonal meshes that have uniform z values in their vertices. I use Camera.ViewportToWorldPoint() to map these viewpoint vertices to ...
0
votes
2answers
213 views

How to stop rotation every 90 degrees?

I was facing another rotation problem yesterday, that i managed to solve by rotating the object like this : transform.Rotate (speed * Time.deltaTime, 0, 0, Space.World); I tried almost every other ...
1
vote
2answers
57 views

How to freeze rotation with a Rigidbody 2D? [on hold]

So I am looking to freeze rotation in the Y axis on a Rigidbody 2D. I'm not sure how to set this in my code. This is what I have so far, can you point out my errors? public class PlayerMovement : ...
0
votes
1answer
14 views

unity onCollisionEnter does not work

I know this question has been asked several times but none of the answers solved my problem. I made an sphere and gave it rigidbody. then I draged the sphere on to a new made prefab. on mouse-click ...
1
vote
1answer
541 views

How to create water with ripples in custom places for top down game in Unity?

I want to make topdown row boat game with Unity. I want graphics to be simple (sprited), but the water must be "very nice" and realistic and it should reflect movement in it (paddles and boat movement ...
0
votes
1answer
830 views

Unity-Animation parameters are not being set

I have the following animation controller: with two parameters of walkingSpeed and Jump. I have the following code which should change the values: animator.SetFloat("walkingSpeed",0.9f); ...
-1
votes
1answer
34 views

Serialization is not saving high score

I wanted to avoid using playerprefs because they are easy to edit. So, I went with Serialization. Here is my main class that does all the scorekeeping: public class scoreKeeper : MonoBehaviour { ...
0
votes
1answer
787 views

How do I add a Rigid body and a box collider component to a Texture2D?

I am making a snake game. I'm basing it on a basic tutorial game, which does no collision detection, wall checking or different levels. All snake head, piece, food, even the background is made of ...
0
votes
2answers
387 views

Find closest point on NavMesh if current target unreachable

I have a mock environment set up with a cube that has a specified "Not Walkable" layer. I'm using NavMeshAgent and NavMeshPath to set destinations of the player. The way I'm setting paths is by ...
3
votes
2answers
1k views

Place an UI Image between two 2D sprites in Unity

I am developing a 2D game with Unity. I have two sprite objects rendered using SpriteRenderer. With the new UI system, I want to use it to display an image between my two sprites. That is, my first ...
0
votes
3answers
70 views

How to check distance between two different vectors?

So I have a very basic racing game, where I would like the car to stop once it hits the finish line. Respectively when the distance between the car and the finish line hits or goes under 0 the car ...
2
votes
3answers
260 views

3D game with Pre-rendered background

So a friend of mine and myself are starting to create our first game together. We descided on doing a 2.5D kind of game, so a static camera that moves with the player but cannot rotate. I got the ...
1
vote
1answer
133 views

Questions about scaling in a 2d game in unity

Okay, so: I am making an android game. I want everything to scale to the size of the screen I'm using. Further, my static background needs to scale (as well as every other object), but if the aspect ...
0
votes
3answers
2k views

Going from WPF to Unity3D, how to implement the MVVM-pattern?

I've been working with MVVM in WPF for a long time and I'm now trying out Unity3D for a GUI-driven application. Can I work with view models and bind them to properties in GUI-components? I guess the ...
1
vote
1answer
57 views

How to script enable VR in Unity 5.1

Unity 5.1 has integrated VR, its in the Build Player Settings as a checkbox. I want a startup scene that is not VR, then when the user starts it enables the VR camera. Can I do that?
0
votes
1answer
35 views

Unity Quality Reduction only reduces my player sprite quality

I created a small map in tiled then imported it into Unity. A small sprite character is controlled by the player to roam about the map. I am experimenting with this for University and wanted to see ...
1
vote
1answer
51 views

How can I mask this CanvasRenderer?

I'm creating a text box that allows for selectable text, based off of Unity's InputField. An issue I am now facing is that the selection highlight does not respond to masks (The parent has a mask, but ...
3
votes
1answer
162 views

Aligning pathfinding to the center of tiles?

I'm looking to achieve tile by tile movement in a project I'm working on. I employed the use of the asset Simply A* Path-finding to allow a unit to navigate the terrain. Since the tiles are ...
0
votes
1answer
52 views

Unity Transform.Position not returning expected position

So in my scene hierarchy, I have an object laid out like so; -Level1 --Level2 ---Level3 ----Level4 My script is attached to the Level1 object. When I try to find the transform.position of Level4 by ...
1
vote
1answer
37 views

Is my collision-free location script working?

I've recently been learning C# and I wanted to take one of my 2D tutorials to Unity. I reached a step where I need to spawn my new sprite into a collision free location. I've followed direction - ...
0
votes
1answer
890 views

Simple heart container script for 2D game (Unity)?

I'm attempting to create a simple mobile game (C#) that involves a simple three-heart life system. After searching for hours online, many of the solutions use OnGUI (which is apparently horrible for ...
1
vote
1answer
92 views

Apply an special effect to an scene area

I have a 2D game where I have a second camera on my scene, that renders an upside down image of the scene, and distorts it, giving the effect of water reflection. I render this camera first, and on ...
0
votes
1answer
629 views

Unity 5 How Do I Set Text of Text Component of Input Field

How do I set the text of the new Input Field's Built In Text UI Object in Unity 5+? myInputFieldText.text = "Text Value I Want"; The code above does not work to set the text inside of a ...
0
votes
1answer
61 views

Unity procedural TileMap generation without creating gameobject per tile

I've been searching all over the internet to find a efficient way to create procedural tilemap without creating a gameobject per each tile. There is none, or simply i couldn't find it, because i ...
0
votes
1answer
35 views

Texture doesn't scale and repeat

I wrote the script for automatic repetition of texture background. To save it I typed Cmd+S. I dragged and dropped the script to Background in Hierarchy. When hit play button the texture doesn't scale ...
-1
votes
1answer
49 views

Why is this unity camera moving in weird directions?

I have the following script public class CameraScript : MonoBehaviour { public bool AllowZoom; public float zoom; public float Speed; Transform board; void Start(){ ...
-5
votes
1answer
61 views

Is it enough to read manuals? [closed]

I want to develop games with Blender and Unity. I don't see any good books out there and so I'm considering reading the manuals of both the software. Should reading the manuals be enough if you're ...
1
vote
2answers
416 views

Testing Unity 2D Physics

I am looking to push the 2D physics in Unity to the extent where when so much is going on that there becomes noticeable lag in a game. This is for testing purposes, so that when so much is going on ...
3
votes
2answers
81 views

How to make sure Sun Shafts are emitted only from background elements?

Currently I have a game scene entirely made of standard sprites using the default material. I use the Unity standard effect named Sun Shafts. I have tried many combinations of shaders and other ...
0
votes
1answer
56 views

Touch Input with Event Trigger. How to handle with it properly

Hello Community, Since this is my first post I wanted to say hello. As every beginner developer I have a lot of problems. Below one of them: I wrote simple script to control my 'Player' object: ...
0
votes
1answer
49 views

How can I increase the speed and frequency of a spawn?

I'm using the official Unity tutorial for the Space Shooter game, and I'm at the part where the ability to spawn a set amount of hazards in a wave at a certain delay is introduced. I want to make it ...
1
vote
1answer
85 views

Creating a curve path for gameObject which reacts to Triggers

I am trying to create a path for a gameObject which will bounce off other gameObjects if it hits them. Can I get an idea on how I could possibly get this curve path set up. Stuck on ideas. I don't ...
0
votes
1answer
92 views

Player position on second player connection

I'm having some trouble trying to run my game for the multiplayer part. I'm creating a 2d game. I have followed this tutorial : ...
0
votes
1answer
72 views

Unity associated game object is null when running

I am just starting with Unity. I have two UI Text game objects, Atext and Btext. I have associated them by drag-dropping with my PlayerController script public variables, say public Text atext and ...
0
votes
1answer
22 views

Isn't OnGUI and Event cyclical?

Here's what I don't understand about Events: the documentation says that Events correspond to user input (key presses, mouse actions), or are UnityGUI layout or rendering events. For each event ...
1
vote
0answers
22 views

Is there a way to build asset bundle that exclude texture2d from an image?

In unity 4.x, I can archive this because I can select my resource type directly as Sprite variable before putting it into the bundle via BuildAssetBundle. However, in Unity 5.x, I need to put the name ...
1
vote
2answers
243 views

What's the difference between Destroy() and SetActive(false)?

I read about both methods in Unity and wanted to ask about which was the best in efficiency : destroying the object or deactivating it. What is the performance difference?
0
votes
2answers
176 views

Basic C# Script in Unity3D for firing a bullet (not working)

working on a 2D top-down view game. Im trying to get my player to fire a bullet when spacebar is pressed. I added a component to my player (a bullet sprite) and placed it under his gun (so you can't ...
2
votes
0answers
54 views

Creating Scenes Programmatically From A Deployed Build in Unity

This is somewhat of an extension to this question: http://answers.unity3d.com/questions/513801/programatically-creating-entire-unity-games.html I have a client who would like to create an entire game ...
1
vote
1answer
11 views

Unity: Can't access repeatDelay from StandaloneInputModule?

I have a very specific problem. I'm trying to change the repeatDelay variable within my StandaloneInputModule, but it's not coming up as a variable. All of the other variables come up when I use ...
5
votes
2answers
321 views

interfacing WiiMote with Unity 5

I am looking for a guide on connecting WiiMote with Unity 5 as an Input device. I found this library here but I do not understand how to install it and what the prerequisites are for it to work.
0
votes
3answers
145 views

Unity3D - How do I make so when user moves the camera it doesn't go beyond the scene borders?

How do i make so when i move my camera, it doesn't go beyond the border of the canvas while playing. This is the script i use to make the camera move: if (Input.touchCount > 0 && ...
1
vote
2answers
145 views

Scaling a UI bar for progress in Unity

I have created a progress bar inside Unity for one of my energy systems. The bar progression works fine. Its just a plane pivoted on one of the faces so scaling it in x axis makes it progress further ...
2
votes
1answer
43 views

Unity C# Object Scaling when parenting by script

How do I make it so an object doesn't scale with another object that I parented it with by script? If anyone knows how to get around this I would really appreciate it. This is the part of the script ...
0
votes
1answer
152 views

Particles in particle system not being lit

I have a sprite that I want to use in my particle systems (it's just 4x4 white square). I'd also like for the particles to be lit (react to lighting within a scene). Since I'm using 2D Toolkit, I ...
1
vote
1answer
49 views

Change Camera Contrast in VR Game

Hello there Firends , I'm developing a Virtual Reality game in Unity. As in every VR game , i have 2 cameras for stereo rendering. I want to show the same object in each camera having different ...
0
votes
1answer
166 views

Controlling roll rotation when travelling along bezier curves [Unity3D]

I am currently working on implementing a curve implementation for use in Unity which includes an editor: The aim is to get an object to follow the path represented by the curve at a constant ...
1
vote
2answers
54 views

How is setting the size of the window done?

Maybe I missed something, but I've gone through 3 full unity video tutorials (roguelike, shooter, ball) and gone through the standalone scripting videos up on the unity site and I'm still confused on ...
4
votes
3answers
142 views

Single Switch Script vs Multiple Scripts

Would it be better to have one script that switches or have multiple scripts with each with their own function? In example, Lets say I am making a powerup script. Option 1: Create a single powerup ...
1
vote
1answer
56 views

How to create gui image with script

So I've been fiddling around with the new UI system recently -- and one problem I have is adding images of my sprites to the ui. I know I can create a prefab of an image gameobject with the sprite ...