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 (2)

3
votes
2answers
108 views

What is wrong with my Chest script?

I'm making an RPG in Unity3D and I am trying to make a script for a chest to open. So I built this script! But it doesn't work. I just want some help fixing this script. #pragma strict var Text : ...
0
votes
1answer
31 views

Transforming position in y-axis (going in the middle) in Unity [closed]

I am making a 2d game where an object goes up, down or in the middle with given Input. But when the object goes to the middle with GoMiddle() it starts glitching and it can't go back up or down ...
3
votes
2answers
42 views

Jagged shadows with default settings

This is what it looks like no matter the settings I use when I try to use shadows in Unity. Changing the Bias or the Normal Bias does effect the shadows, but I cannot get the shadows to be smooth with ...
0
votes
1answer
35 views

2D diagonal movement using Rigidbody2D

I have a problem with 2d player movement, as I am unable to move on the Y-axis. Yet, the movement on the X-axis is working as intended. Below, you can see my code: public Sprite directionUp; public ...
1
vote
2answers
46 views

Randomly instantiate avoiding overlapping in Unity 5

I'm starting a 2D game where I want all the letters A-Z displayed in a random position and, then, the player collects them all in the correct order. I need to randomly instantiate the letters without ...
1
vote
1answer
36 views

Programatically Build List of Custom Class Objects (prefabs)

This seems like it should be a simple thing, but I cannot seem to figure out a method. Currently, I have a public List<MapGraphItem> roomList variable, and in the inspector, I add prefabs from ...
1
vote
1answer
49 views

Unity Rotation - Object is rotating on Z, but should be rotating on X

I've been working on a project where I have a cube. When swiped left, the cube will rotate 90 degrees the left, and then when swiped right, the cube will rotate 90 degrees to the right. I have this ...
1
vote
0answers
29 views

Problem in player Rotation in Unity

I am trying to rotate game camera using my android device orientation.Like this Using accelerometer input of device this may be done. But I don't know how to do this. I tried lot of methods, but ...
3
votes
2answers
49 views

Preparing a 2D character to export from Blender to Unity?

I'm an animator for a game currently, and I don't have Unity (can't download due to too much gigs coupled with slow internet,) but the game designer told me I can use Blender to export animations into ...
4
votes
1answer
86 views

How do I differentiate between the two Vive motion controllers?

I am working with a Vive Pre (devkit) and I have most everything working the way I want it to. However I am wondering how do I refer to or even know which motion controller is which? From what I can ...
1
vote
1answer
29 views

Technique to find a mesh intersecting with a primitive solid without using colliders?

For what it's worth I'm using Unity3d, but I believe the problem is more general. There are hundreds if not thousands of meshes with hundreds of vertices each. There is one sphere that can be ...
1
vote
0answers
14 views

Why in Unity my character not moving 360 degrees using the mouse ? Only to the right and left? [closed]

I didn't change any mouse settings but suddenly my scene only moves to the left and right (not 360 degrees as before). I did add a spotlight but I don't think this is the problem.
3
votes
2answers
74 views

How do you restrict sideway movement in 3D endless runner in Unity?

I have been making a endless runner 3d game and implemented 3 lane side way movement. It's working perfectly, although I want to restrict my movement for the 3 lanes only. If my character for example ...
1
vote
0answers
37 views

Fixing wave-like movements when rotating an object using mouse input in Unity

I have encountered a rather odd issue with my program. The setup: In my scene, I have a GameObject which I have set as my player/character for this game. The player/character has a child GameObject, ...
1
vote
0answers
17 views

How to check for string endings for loading save files? [migrated]

I need to know how to check for the endings of all the files in the Assets folder. Its for creating a list of saved files. public static void Load() { if (File.Exists(Application.dataPath + "/...
1
vote
0answers
39 views

How to create a correct Unity package copy, which will not be replaced when you import?

I create a "Package 1" consisting of section A (unique) + section B (which will be repeated in all my other packages). This package works correctly is he is alone. Next, I create a "Package 2" ...
0
votes
2answers
49 views

Transforming Position in y-axis (going down) in Unity

I want the gameobject to go down (position.y) after pressing a key instead of pressing the key repeatedly. So in my current code the object goes down(0.05f) each time I press a key. But I want it to ...
1
vote
1answer
23 views

Unity SOAP wsdl problem

i'm trying to using a SOAP service from my game but the problem is that after using wsdl.exe for generete the connector Unity inform me that System.Web namespace doesn't exist. How can I use the wsdl?...
1
vote
2answers
36 views

Unity : Objects become black when size is changed to smaller

While working with Unity 5.4, my models become black when I resize them to a smaller scale. When I make the models bigger they are fine. I am using a directional light . On the image below as you can ...
5
votes
1answer
88 views

Unity - Small holes of light seems to go through my blender mesh

So, I am currently working on a low-poly terrain in Blender which will be flat-shaded in Unity. It all works great, however I am working on a cave for the terrain, and I seem to be getting these small ...
1
vote
1answer
52 views

Multiple Sprite animation layers overlayed in Unity Animator

I have an animator with two layers, an axe layer and a body layer. I would like to animate the two in sync with each other. They are both 64x64 sprite animations, frame-by-frame bitmaps. The ...
1
vote
1answer
35 views

Check if vertex is visible in shader

Im trying to figure out when a vertex is visible from the main camera. I have this function: bool in_frustum(float4x4 M, float4 p) { float4 Pclip = mul(M, float4(p.x, p.y, p.z, 1.0)); ...
2
votes
1answer
28 views

Unity API - Making a Sphere Jump?

I'm making a very simple game with a sphere that's supposed to roll and bounce on "planets". Also, please be ready to read a lot. I want to be very descriptive for you. :) I've pretty-much-done ...
3
votes
2answers
47 views

Clamping camera forward and backward vector in Unity3D

My perspective camera is rotated on the x axis. I've implemented a zoom with the scroll wheel and it works great. I'm trying to limit the zoom, however. My solution right now is to take the relative ...
3
votes
0answers
28 views

Unity's Touch API is exposing only half of the available Android touch data (image attached)

Unity is only exposing half of the touch data that Android itself receives. I'm using the standard Input.touchCount and Input.GetTouch() API. My test scene is quite simple. My game is precision swipe ...
1
vote
1answer
62 views

Unity 5.3.5 - How to setup a lobby with general game settings?

I am currently working on the lobby for my game. I have followed these tutorials (https://www.youtube.com/watch?v=jklWlm5v21k), which were very helpful, and was able to setup my lobby like this. The ...
2
votes
1answer
108 views

Infinite ball bouncing problem (Unity)

I am trying to develop a basic Breakout game using this tutorial using Unity 5. But the ball starts to bouncing infinitely very easily. I cannot understand why this happenes. In my physics knowledge ...
1
vote
0answers
13 views

Move around the object using head tracking movement in Unity

I am developing an app for Samsung Gear VR with unity.I have added a cube and made the cube move forward on the terrain. Now I need to move around the cube using head tracking movement.I have ...
1
vote
0answers
18 views

How to apply specific torque to configurable joint in Unity

I have a torque vector that needs to be applied to a configurable joint connecting two rigid bodies. This joint configured in such a way, that it only allows angular motion around all 3 axes. Is ...
1
vote
0answers
23 views

Skewed 3d model when moving device around with Unity and Vuforia

I am having trouble with the orientation of a 3d model that is larger (think queen-sized bed) than the target image(a4 size bond paper). The model appears to be slanted in a way that looks totally ...
1
vote
0answers
28 views

Unity Asset Store Tools Problem

So I downloaded Asset Store Tools in the Unity Asset Store. When I upload my asset to my package, I get this popup: Wrong project path The path selected must be inside the currently active ...
1
vote
0answers
31 views

Cardboard VR Mode rendering black in Unity

I've searched around and seen this problem is quite common, but none of the fixes I've read have resolved the issue: If VR Mode is enabled in the GvrViewerMain prefab, the scene will render as just a ...
1
vote
2answers
63 views

How to write from shader to a texture to a PNG in Unity?

I want to write the information from my shader into a texture and save it in a png. I found this: http://forum-old.unity3d.com/threads/save-texture-generated-by-a-shader.326561/ and this System.IO....
1
vote
3answers
105 views

Delay for seconds when key is held down?

Hello I am very new to Unity and am trying to make a shooting game in which when the space key is pressed down the gun charges then shoots. I want it to wait for 0.3 seconds before the gun fires off ...
4
votes
2answers
103 views

Unity pixel art distorted sprites

I have a problem rendering my pixel art sprites properly in Unity. So far I have one character in a sprite-sheet I made, with frames of size 64x64. The actual sprite is roughly 32x32 but I left room ...
1
vote
1answer
31 views

Unity / Passing an array in a shader

I want to pass my array (which is inside my c# code) to my shader. Shader "custom/shader4" { Properties { _myArray("Array", Float[256]) = [] } SubShader { Pass ...
1
vote
0answers
35 views

lightmap equivalent with realtime shadow

i'm using in Unity free edition. I try to bake a lightmap which equivalent feeling with Unity's real time light map and shadowing, like left figure. But the result is the right figure. How can i ...
0
votes
2answers
65 views

one time rotation Unity [duplicate]

How do I rotate the object only once after a key press. So after it rotates say 10 degrees upwards, the user can't rotate it anymore. this is my code which as continuous rotation -: void Update(){...
0
votes
0answers
19 views

Rendering a particle system composition into a animation

I've been recently messing around with the particle system in unity, however this can have quite the impact on performance, specially on cellphones. So my question is, is it possible to create a ...
1
vote
0answers
18 views

How to access “move” values from move node in Rain behavior tree?

I have a blend tree for the NPC that takes an "input magnitude" value--0 to 1.0--for how fast the character should move...and an "angular input" float-- negative pi to positive pi--for how fast the ...
3
votes
1answer
45 views

Unity, Solid Color to link Platforms

[UNITY] As you can see above a solid color is connecting one platform to another. My question is whether this color must be applied through code or through a sprite. In my game there are three lanes ...
3
votes
1answer
60 views

How can I search for players in the same wifi in Unity?

I am creating a game in Unity and I would like to create an ability for players to join the game that others have created on the same wifi. I would like it to be as effortless as possible(e.g. players ...
3
votes
1answer
64 views

How can I create “events” that are called in scripts without requiring subscriptions?

I am creating an editor extension that includes an API for developers to use. It also includes events like (for example) "OnHealthChanged." The problem is that events I have stumbled upon would ...
1
vote
0answers
41 views

Collision Detection between two instances of the same Prefab

I am a trying to recreate the first stage of Super Mario Brothers, but I am having a bit of trouble with the collision system between Koopa Shells. I have written two different scripts in hopes to ...
1
vote
0answers
26 views

Unity 3, TouchScript - Detects touch position each time it changes position

I have a big problem here. I am making a script to detect a circular swipe, so I need to continually detect a touch position that keeps a magnitude and that the angle is relative to the former angle ...
1
vote
1answer
84 views

How to align a hint arrow to point along a path?

I am using CalculatePath and trying to use path.corners in order to give user a hint for path, that where should he lead next. I am using first two instances of Vector3 of path.corners. Lets call ...
-4
votes
2answers
96 views

Distance between the player and another object Unity

Edit: I want to find the distance between the player another object. How do I do that? this is what I tried: public GameObject other; void Update() { float dist = Vector3.Distance(other....
0
votes
1answer
39 views

Unity / How to add a shader to a material via c# script?

I found already some things - but those seem not quite what I need. (perhaps outdated functions?) https://docs.unity3d.com/ScriptReference/Material-shader.html here, it seems you can add a shader to ...
0
votes
1answer
76 views

OnApplicationPause()/OnApplicationFocus() in Android/IOs

I searched in Unity Documentation but there are no information. I'd like to know which methods is called and what it returns in the following scenarios on Android: App initially starts App goes in ...
1
vote
2answers
37 views

Implementing an interaction system that can perform different tasks dependant on the object you are trying to interact with?

In No Mans Sky there are objects to interact with in the world and the result of the interaction changes depending on the object. For example, if you interact with a plant it will give you resources ...