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
738 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); ...
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 ...
0
votes
1answer
25 views

unity — object references, why do I always get errors?

For context: I randomly generate a few points on the map, and each point is a gameobject with a script containing an OnMouseDown method. Here's the relevant pieces of code(I've omitted the irrelevant ...
0
votes
1answer
747 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
285 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 ...
0
votes
0answers
19 views

Character body morph in Unity using Blender models

I have character and clothes modeled in Blender. Everything rigged, weighted and mecanim compatible. All working good in Unity. I am trying to implement in-game character body shape customization. ...
2
votes
2answers
654 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
1answer
20 views

How to put labels at a specific point on any resolution

I am working on a project in Unity 4.6.1 and I put the label at the top: But when I put the Scene in full view this happened: I made a Development Build and when I select my resolution (1366x768) ...
2
votes
3answers
191 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 ...
4
votes
3answers
2k views

Lights shining through walls

I'm currently having a problem with lights in Unity. They shine through walls for some reason. Point, directional, etc. If a light is next to a wall on one side, you can see it on the floor on the ...
0
votes
3answers
55 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 ...
1
vote
1answer
118 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
0answers
12 views

How do I have a player also be a server? [Unity 2d]

I'm trying to make a game in Unity 2D, and I need a player to be a host because I can't afford dedicated hosting. Each client will have files that the server (and other clients) need to be able to ...
13
votes
2answers
847 views

Make platform's visibility distinct from background

I have a 2d infinite runner type game which background is changing its colors constantly. Meanwhile the color of the platforms stays the same. This way the platforms at some point(when their color is ...
0
votes
0answers
19 views

Failed to load plugin in Unity mismatch with 64-bit and 32-bit

I am building a game in Unity and I am trying to load a dll from the plugins. I am running on 64-bit windows but I want to build a 32=bit game. When I try to load the dll I get this error Failed to ...
-1
votes
1answer
16 views

Unity: Prefab image is scaled

I have a question regarding to the size of images in the prefab versus UI/Image. When I drag prefab(SlotWheel) into the Scene editor, my images get scale larger. The original image that composed ...
2
votes
1answer
145 views

Basic Node Based Pathfinding

I am new to pathfinding but i have read and watched through some articles, blogs and videos about Pathfinding. Since those that i have read and watched from are mainly for RTS Games, Grid Based ...
0
votes
0answers
21 views

Lighting changes when loading scene

I have a script that changes the levels using Application.LoadLevel (sceneNameToChangeTo); Once a level is loaded using that code when testing with the editor, the lighting changes dramatically. ...
3
votes
1answer
146 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
33 views

Scaling images in Unity

I have a question about how scales work in Unity (using 5.0). I've made a .gif image that is 100x100 pixels in size. I put it in Resources folder under Assets. When i drag it onto the scene it ...
2
votes
1answer
56 views

Is Physics2D.BoxCast a safe alternative to a row of raycasting?

Raycasting in rows is a common practice. Is using the Physics 2D BoxCast function a good alternative to using multiple raycasts spread out (an example use being collision detection in a custom ...
-1
votes
1answer
46 views

Are the prefabs stored in RAM or in the Hard disk? (Unity3D)

I have many prefabs objects (65 MB) in an Unity3D project. My game use 100 different levels with combinations of the prefab objects. What is better create 100 scenes or create only one scene where ...
0
votes
1answer
825 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 ...
3
votes
5answers
1k views

Trying to implement gun cooldowns in C#

My aim is to allow my player to shoot 3 bullets at a time. Between shooting these 3 bullets the player should wait a very small interval (so that they don't all get fired at the same time) - call this ...
0
votes
0answers
33 views

Saving a c# script in a javascript variable(unityscript) [closed]

i am modifying the inventory system made by brackeys. https://www.assetstore.unity3d.com/en/#!/content/10384 Now i want to define a c# script into a variable inside the character.js file. It looks ...
0
votes
1answer
392 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
0answers
13 views

Unity not importing pivot points?

To start things off, I begin with the following set of procedures: Begin with a model in 3DS Max, which I will refer to as Cube. Confirm that Cube's pivot point is exactly in the center of it, which ...
0
votes
0answers
18 views

Unity 2D: Lighting ground tiles in a sidescroller?

I'm trying to find a good way to tint the ground tiles in my 2D game at sunrise, sunset, etc. I thought it'd be a good idea to use a diffuse material + lighting in order to create effects by ...
2
votes
0answers
961 views

Unity 4 mecanim; 'Quaternion to Matrix conversion failed, input quaternion is invalid'

I'm trying to animate a stick figure in Unity, with placeholder animations. Character is built/animated in Blender, exported to FBX. When imported to Unity, everything appears correct in the editor. ...
1
vote
1answer
81 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
26 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: ...
2
votes
2answers
72 views

Simulating beer pong physics in Unity

I'm trying to create a simple beer pong game in Unity. The basic idea is this - when it's your turn to shoot, you use your mouse to pick a point on the table that you want the ball to hit and bounce ...
3
votes
4answers
258 views

How to enter a level when touching an object

I am working on a project in Unity 4.6.1f1 and I was wondering how can I make a cube touch another cube to go to the next level (the image below)? ! EDIT: I made a script and put it on the purple ...
1
vote
0answers
37 views

Algorithm for creating mesh from 2D image silhouette

I'm looking for an algorithm that can take a 2D image, approximate it's shape and then generate a low poly mesh. Basically, the same what Unity does with sprites when you select tight mesh instead of ...
1
vote
1answer
64 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
0answers
5 views

Alpha Lambert Shader Transparent even when Alpha is 1?

So I'm writing a shader that has to be differently transparent in different spots. However, when I use #pragma surface surf Lambert alpha, the object is partially transparent even when I force alpha ...
0
votes
1answer
78 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
56 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 ...
1
vote
0answers
71 views

why is my (from example) shader appearing as black?

I have the following (very simple) shader: #pragma kernel CSMain RWTexture2D<float4> Result; [numthreads(8,8,1)] void CSMain (uint3 id : SV_DispatchThreadID) { Result[id.xy] = ...
0
votes
2answers
105 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 ...
0
votes
2answers
121 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
134 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 ...
0
votes
2answers
58 views

Moving a character depending on the direction he is facing (C#/Unity3D)

Right now I have a small soldier on the screen that moves with W, A, S, D and rotates / changes direction with the arrow keys. What I want to happen is when the player's direction changes (by using ...
1
vote
2answers
1k views

Is it safe StringToHash() to use in Unity?

I'm currently browsing through the Unity tutorials and saw that they're recommending to use Animator.StringToHash("some string") to created unique ids for animation properties (see here). Since I'm a ...
0
votes
1answer
102 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 ...
0
votes
2answers
252 views

What is the best type of c# timer to use with a Unity game that uses many timers simultaneously?

I am developing a stand-alone 3d game in Unity that will have anywhere from 1 to 200 timers running simultaneously. There will be a GameObject containing 1 timer. For this game timer durations will ...
0
votes
1answer
132 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 ...
0
votes
0answers
27 views

Will I be able to use scripts included in an Asset Bundle as long as the script was in the game build?

For example, I have a script, let's call it "script.cs". If this script is in the script folder(somewhere inside the Asset folder) during build, will I be able to reference it(load an object with this ...
1
vote
1answer
39 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 ...
1
vote
2answers
40 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 ...