Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
7 views

How to make UI text longer?

I'm working on a menu that needs a wordy description, but I've noticed that it only shows 4 letters, then cuts off and this doesn't seem right. I right click, select UI > text and again, it only ...
0
votes
0answers
7 views

how to change value of variable only once?

I am building simple platformer game in which the player hops on to platforms and the speed of platforms increase per time. This is an endless game and depends on the high score system. But, the ...
0
votes
0answers
6 views

Layers in Unity won't drag

I'm trying to rearrange my layers in Unity but I can't seem to drag them. When I try to do this I'm in edit layers under the heading sorting layers and I click on the = symbol and try to drag it but ...
0
votes
0answers
6 views

Textures in build duplicated, despite they're packed into atlases

I have a simple SpriteAtlas: "UIAtlas" which is located in the Resources folder. It points to a folder "UIAtlas" which contains ...
0
votes
1answer
17 views

Unity: Unable to rearrange “Sorting Layer” for 2D game

Since yesterday I got a bit into game development with Unity (i've never done game development before), and I am currently making a small 2D game. I am attempting to rearrange the various layers in ...
0
votes
0answers
10 views

divide axis of a vector3 object for cover all the object

im triying to divide the axis of an object in a vector3 for what cover all the object, the idea is simulate a collition, i havent permission of use colissions, and rigidbodyes, only transform and ...
0
votes
0answers
27 views

How can I change position of camera?

I'm working on 3D game, where the player needs to complete 4 play fields called "homes" in level 1, then progress to level 2 which has 4 homes of its own. In level 1, when the player completes the ...
0
votes
1answer
26 views

Tile manipulation script doesn't work in build but works in editor

I have 100 cubes which makes a plane, and I have a script that moves those cubes in random patterns according to random chosen methods. For example, in the method ...
1
vote
1answer
16 views

Unity is losing track of changes to Resources

I have a Unity project, where I recently changed the names of a few files in my Resources folder. This is relevant because I have code that looks like this: ...
0
votes
0answers
7 views

How to keep data between scenes in unity? [duplicate]

I have a button which changes the color of line renderer, each time you press the button this changes sprite and each sprite represents a color. After the player chose a scene where he could draw with ...
0
votes
0answers
10 views

MIRROR: Connect Android client to PC server?

Using the Mirror NetworkManager alongwith the NetworkManagerHUD, I made two scenes: one for server, one for client. The client one I built out to Android, and started up the server one on laptop, ...
4
votes
1answer
65 views

Fastest way to regroup every cell with the same value into a cellular noise

I'm working on a Map Generator, who are computed based on multiple height-map (I'm using FastNoise Asset on Unity Store to get all data) and they are split into Chunk. Some noises are "cellular" and ...
1
vote
0answers
13 views

Empty game object (child of player) not changing position correctly when key pressed

I've made an empty game object which is the child of the player. It is by default on his right side and following his every move, and I want to make it so that every time a directional key is pressed (...
1
vote
0answers
26 views

How can I get my player's character to slide along a rail?

I am creating a snowboarding game and would like my player to be able to jump on a rail and move along it if it lands on it. I have no idea how to approach this. I have already tried using ray casts ...
1
vote
0answers
11 views

How to import a texture to be used as occlusion map?

The same way normal maps need to be imported as "Normal map" in the import settings, how should I setup an Ambient Occlusion texture to correctly work? I've been searching around in the manual and ...
0
votes
0answers
29 views

Unity 3D HDRP - Making a hole in a gameobject by shader using stencil

Unity version 2019.1.2f1 HDRP project. I am trying to make a hole in a finished gameobject which has a material and shader don't want to interfere with, the point being this should work with any ...
0
votes
0answers
21 views

GetComponentsInChildren<GameObject>() raises error [duplicate]

I have a gameobject to which a script is attached. In this script I have the following code: ...
0
votes
0answers
37 views

Character Controller + Lag = Massive Teleportation Through Walls

I'm working on a fairly robust game with another developer and we've been having a really serious issue with (I believe) the character controller. Specifically, if there's ever a large lag spike (as ...
0
votes
0answers
6 views

Memory Size field in WEBGL Player settings missing

The memory size field is missing from my HTML5 player settings. Do you know how to bring it back? I'm using Unity 2019.1.0f2 Thanks]1
0
votes
2answers
23 views

how to detect touch on instantiated prefabs in unity

I have instantiated objects (that have collider2D attached) in a grid of 9x13. Now I want to detect a touch on each object ...
-1
votes
1answer
59 views

How to detect least distance to line segments calculation

I'm trying to calculate the distance of the player to a few lines that intersect two points, and return the smallest distance (i.e. tell me which of the lines the player is closest to/how far the ...
0
votes
0answers
43 views

Set UI text using value from separate script

I've been working on the TANKS! tutorial from unity, attempting to add a U.I overlay that displays the scores of each player. Cannot seem to get it working with the current setup the game has: Each ...
0
votes
0answers
12 views

Does CharacterController benefit from adding lerp?

Does CharacterController benefit from adding lerp? as in this script. ...
0
votes
2answers
72 views

A* GetNearest() implementation

I'm trying to implement pathfinding in my platformer and I'm having trouble coming up with a way to find the nearest node to a world point. I tried this: ...
0
votes
0answers
13 views

Opinions regarding 2d mobile platformer development framework [on hold]

I'm currently in dubio about which language / framework I should use to develop a 2d mobile platformer rpg. I have experience in Unity, C#, Android Studio and Java, but can someone provide some advice ...
0
votes
0answers
18 views

Unity - Spawn Bug

I really need some help with this issue; I can't for the life of me figure out what's wrong or how to fix it. Basically, if you move the character to the hut and press Return, their new spawn position ...
-1
votes
0answers
21 views

Putting scripts togther

I am trying to replace the exe file UCI connection in Unity from this file ...
-3
votes
1answer
42 views

how to call function [duplicate]

how do I get a function from another script and insert it into a button, I did this is giving this error "Object reference not set to an instance of an object" ...
0
votes
2answers
42 views

change one object into another, and then back again in Unity

For example, I would like to change a cube into a sphere, then change that sphere into a capsule, by pressing the up arrow. I would also like to be able to change in the other direction. Change the ...
0
votes
1answer
79 views

Most Efficient Way to Check Player Distance from a Line?

I need to get the player's distance from a line (or the outside edges of an Gameobject, if that's easier) throughout their time in the game. I need the code to be fairly simple because I'm a novice (...
0
votes
1answer
32 views

Testing a Client's Camera in a Multiplayer FPS

I'm attempting to do a logic test regarding a client's camera in a multiplayer FPS in Unity and I'm a little uncertain of which way to implement the functionality. The scenario: - I have a host and ...
0
votes
0answers
24 views

Restarting a level but with more time?

So I'm trying to add a "Rewarded video ad" with the reward being more time to play in the next game. my RewardedAd.cs: ...
0
votes
0answers
20 views

Apparent FPS drop despite clear CPU usage drop in profile window

I have an unusual performance drop (or visual choppiness) that isn't showing in the profile window at all like I'd expect. When using Vegetation Studio Pro and AQUAS together, I get what looks like a ...
1
vote
1answer
21 views

Running into issues with Unity Vertical Layout Group

I feel sure that I'm missing something obvious, but I've been stuck with this over the past few days. I want to make a relatively simple UI component for a character creation screen that looks ...
0
votes
0answers
10 views

Unity IAP button not working on Google Play

NOTE: English isn't my mother tongue, so sorry in advance for any grammar mistakes. I'm totally newbie and this project has no intentions of making money. It's just an experiment and it will be ...
0
votes
1answer
40 views

Violation of Usage of Android Advertising ID policy

I made a game in Unity with admob integration, and I published it on the Google Play store. After 2 days I got a mail from the Play store mentioning a policy violation (reproduced below). I l ...
0
votes
1answer
36 views

How to only call write function when value from series of IF statements change

I'm calculating the distance of the player from a point at any given time point in the game (using a series of IF statements), then returning the label associated with the nearest point. So that I can ...
0
votes
1answer
39 views

How to pass more than one parameter for an object?

I am typing a code using C# in unity for game called Sea Gauntlet. In this game, there is a hero ship which I am suppose to control to do certain tasks. Along with that there is whirlpools, drones ...
0
votes
1answer
19 views

Object highlighting. Changing material colours in Unity

In Unity I am using a script to highlight selected objects, in this case by making them greener. However for some reason the objects aren't unhighlighting properly. When I unlight them they aren't ...
0
votes
0answers
12 views

Problem with camera deapth culling only option and objects in front of each other

I have a prefab with 2 cameras. the 1st is rendering the world, the 2nd one all the suff in front of the 1st person characters "face". Now i have a problem with a gun using a muzzleflash - both on the ...
1
vote
0answers
47 views

Why is my character jumping at different heights randomly?

I have a character controller on my character's gameobject and I'm trying to make the character jump. This is working but sometimes he jumps way higher than other times. Does anyone know why this is ...
0
votes
0answers
41 views

Work Experience [London]? [closed]

Does anyone know any companies in London that are offering work experience. I'm only looking to work for a day or so, because I am a full time student. I'm learning to code and make games. Just ...
0
votes
0answers
30 views

Unreal Or Unity For Game Development (In the long run)? [closed]

I've been thinking about getting into game development for a while now, but i'm having doubts where to start. My main language is C++, and I've created a snake game ...
2
votes
1answer
24 views

Shadow flickering with first-person near clipping plane

After adding a first-personal controller asset, world shadows flicker like crazy. I don't understand the cause, and everything I've tried based on googling has failed to help. https://i.imgur.com/...
0
votes
0answers
32 views

3D Model Polygons Optimization in Unity

Quite recently I started working with Unity, 3D modeling and all the rest. My task was to build a level in unity and record a video through the unity recorder - I do not make the game. I make a cut ...
0
votes
0answers
24 views

Gameobject rotation around anchored pivot

I'm looking for the best way to rotate the Camera(EYES) around a center of my character (Player Prototype) because if I turn around, the Camera enter inside the character. My FPS script is attached to ...
0
votes
0answers
24 views

Custom node editor in Unity

Im currently making a game on unity, and in the game i want to make quest system to be flexible, as the game world is generated randomly. I also want to make it easy to create quests for myself and ...
0
votes
1answer
75 views
+100

Why WebGL Audio isn't working?

I need to download audio (OGG, Mp3 or wav) from URL and play it. In Editor is working fine, and also in stand alone build. But not in WebGL build. My Code: ...
0
votes
0answers
8 views

Extrude 2D Mesh Vertices In Surface Shader

In a surface shader, how do I calculate the external angle of a vertex and extrude it along that direction? What I want is to created a border around a 2D mesh. The Z value of every vertex is 0 so I ...
0
votes
1answer
22 views

Unity UI Dropdown list rendering on top of other canvases

I have 2 screenspace canvases in my scene.. Canvas 2 has just the mouse pointer image on it, the canvas has a sort order of 10. Canvas 1 has everything else on it, it has a sort order of 0. The ...