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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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
27 views

MoveTowards object stuck with isTrigger Collider

I am trying to have a missile seek its target once it has entered the target's trigger. The code should be fine, I think it has something to do with how the colliders are operating. I want the blue ...
0
votes
0answers
22 views

Resolving this kind of situation in my platformer (movement on slope with roof)

I'm building a simple 2D character controller based on raycasts. At this moment I'm trying to finish the player-ground interaction. For the ground I will be using edge colliders and no tiling ...
0
votes
0answers
16 views

Unity3D mobile 4G internet web request is very slow

I have a windows VPS server and i have installed an Apache server on it. in my server I only have a simple text file that contains some few words. My problem is that when I'm trying to sending a web ...
1
vote
0answers
26 views

Seaming between procedurally generated terrain meshes in Unity

I have been generating procedural terrain for an upcoming project however I am coming across a seaming effect between the tiles: I have searched for solutions including this video. Here is the code (...
0
votes
1answer
45 views

Show Sprites on Overlap (Shader Graph) [2D]

I have a character sprite mesh and mesh renderer (The black wavy box). I am hoping to be able to overlay the black box onto the character covering the sprites but I am not sure how to do that. I ...
0
votes
1answer
60 views

Changing the camera in Unity

I am trying to make a game like Mario Party in Unity. I want the camera to automatically change between players after each turn. I don't have a lot of experience in C#, and I totally would learn ...
1
vote
1answer
75 views

Is there performance difference between OnCollisionEnter and OnTriggerEnter?

Is there performance difference between OnCollisionEnter and OnTriggerEnter? I have around 12 objects all calling OnCollisionEnter when in fact OnTriggerEnter could work as well. So I wonder if the ...
0
votes
2answers
66 views

Problems generating procedural mesh

I have this code below that I found on catlikecoding that generates a procedural grid that I want to apply noise to, however once I go over a certain value it does expand vertically. Can anyone see ...
0
votes
1answer
48 views

Smoothen line on linerender

I've created a square using linerenderer but my problem now is that the line is not smooth. see below picture. I've tried enabling anti-aliasing and setting lr.numCapVertices to no avail. ...
0
votes
1answer
44 views

Unity - Play animation based on horizontal drag position

So, what i want to do is some what complected, but I'll try to explain it to the best of my ability. I am using Unity's EventSystems events to detect a drag. When the user drags the object ...
23
votes
1answer
6k views

How do I prevent inappropriate ads from appearing in my game?

My game implements Unity ads, and is designed with a universal audience in mind. As such, I would prefer not to have 18+ ads (or even 13+ ads depending on the circumstances) appearing in it, ...
1
vote
2answers
58 views

Select Unity Prefab from enum choice

After a couple tries, I still haven't found any solution to this problem of mine. Currently, I have a script inheriting from MonoBehavior which creates a map with Perlin Noise. Let's call it ...
4
votes
0answers
59 views

How can I make Unity run fast when it's not focused?

I'm using Unity3D. I have an automated test suite that takes 1-2 minutes to run. When Unity has focus, these tests seem to run at least 2x as fast as when Unity is in the background. But, it's very ...
0
votes
0answers
36 views

How can I change the parameters of the random events for each game entity?

I'm trying to write an easy-to-use random event system that has certain conditions and effects in Unity. It's a simulation game that contains multiple Person, City, Country, Faction elements. I have ...
0
votes
2answers
41 views

Why Some objects or prefabs don't respond to mesh collider?

I imported some assets and, I used some prefabs from that assets. Some of them responds when I add the component of mesh collider to it and disable the ability of going through with it. But some of ...
0
votes
1answer
21 views

How To Deselect (Unfocus) All gameObjects in a Unity Scene View?

When I'm done with moving and rotating gameObjects in a Unity scene, I want to deselect everything to not accidentally change it. How? In some applications ESC key does the trick, in others 'D' (...
1
vote
1answer
73 views

Why do my NPC's fall through the world when I select them as triggers?

I'm making a game in Unity where when the player comes into contact with an NPC it will switch scenes. I have the code for it and made sure all NPC's have rigidbody as well as using gravity and convex....
0
votes
0answers
13 views

Using Azure with Unity

I currently use Unity 2018.3.9f1. I would like to hook up my Unity program to an Azure service, so that I can store/analyse information about user behaviour. As a primer, I tried to import the ...
0
votes
1answer
52 views

Make half of the sprite transparent

Guys if I have two sprites placed on the same spot. How can I show the half of each Sprite instead of the one on top? The sprites are basic circles All sprites have basic colors, no textures.
0
votes
0answers
39 views

How does Unity store references to GameObjects in a scene

A Monobehaviour can have references to GameObjects in the same scene, but Prefabs, ScriptableObjects can't reference GameObjects in a scene. While Assets, Objects and serialization covers references ...
0
votes
1answer
56 views

How can I draw a rectangle with a color gradient?

I'm trying to implement below picture in my code but doesn't work. It only shows red color on all sides. I'm using line renderer and color gradient. Kindly check my code. Thanks in advanced ...
0
votes
1answer
25 views

Unity Proximity Warning System Trigger issues

I'm trying to set up a proximity warning system but I'm having some trouble. To simplify things as much as possible: I have two game objects in a scene (Object1 and Object2). Object1 has a large ...
0
votes
0answers
64 views

Why is the play button not working on the title screen of my game?

I'm trying to open up a game demo from my class to see what it looks like, but after opening up the project in Unity, the title screen doesn't work correctly. When I try to click the "Play" button, ...
1
vote
0answers
33 views

making a tangram game in unity, how to detect when shapes match

I'm making a 2D game in Unity that's kind of like tangrams, a puzzle game where you form a specific shape (given only an outline or silhouette) by arranging smaller geometric pieces, which can not ...
0
votes
1answer
54 views

Integrate Stripe with Unity

I'm trying to install the Stripe API Library through NuGet Manager in Visual Studio but it installs it inside packages folder of the Project (I.E. before Project's Assets folder) doing this I cannot ...
1
vote
0answers
35 views

Changing color for each element in linerenderer not working

I want to change color for each line (element) just like in color switch. But my code is not working. What I wanted is that the right line should turn blue then the down line should turn color red. ...
-2
votes
1answer
33 views

How many unity version support with 1 seat?

I bought plus unity license 1 seat so Can I use it on 2 unity version Example: Uity5.3.4p3 and unity 20183.18f1 Or it use only for one version?
0
votes
2answers
33 views

Unity3D - Generate a position within a circular band around the player

Given a certain condition in my game I need to generate a position around the player. It needs to be at least 8 meters away from him and within 10 meters, in a circular matter, as in the dotted green ...
0
votes
1answer
28 views

Downloading image to apply as a Texture fails

In my app I need to download some images and apply them as Textures. If I use following code to get image from my local pc hard disk, it works. But it does not work if I use a url like (http://www....
-1
votes
1answer
16 views

Can I use my Unity Plus licence with Unity version 5.3.4p3?

I had Unity 5.3.4p3 from 2 years ago, and I want to use it for my current project. Since then, I've purchased a Unity Plus licence. Can I use that licence to develop and publish my Unity 5.3.4p3 ...
0
votes
0answers
17 views

Button click event not triggering

I am using a button and have attached the appropriate onclick event, but whenever i click the button when playing the scene it clicks the button but it doesnt call the onclick event. Here is a ...
0
votes
1answer
19 views

Send a Push Notification from a device to another device (Unity, Firebase)

I have setup Firebase authentication in my game for Android. I need to implement a feature in my Android game, where a user can challenge another player. I need to implement it this way: The user is ...
0
votes
1answer
65 views

Unity Networked gaming 2019… What happened to NetworkBehaviour, OnServerStart() etc

After a long break, I am now trying to learn some basics in networked gaming in Unity. I've installed the latest beta client (because I want to ultimately make a network multiplayer game but it will ...
2
votes
1answer
106 views

How to UV map a procedural cylinder mesh? (Unity)

I have a script that generates a procedural cylinder. Each side is a quad that consists of two triangles. The two triangles share vertexes, so, a side with two triangles is defined by 4 points. The ...
0
votes
0answers
25 views

Remove READ_PHONE_STATE permission from Crashlytics in Untiy

Recently I have added Crashlytics to Unity and now the game is asking for permission to manage phone calls. How do I remove it from the game?
2
votes
2answers
52 views

Preventing the mouse from breaking keyboard navigation in UI?

I am trying to achieve the following, a behavior like Windows Explorer where mouse and keyboard play nice together. Here's a GIF along explanations: first I click one of the folders using the mouse ...
2
votes
2answers
44 views

Rotate on one axis, but visibly keep the other axes stable and editable

It's been a long two weeks. Quaternions are freaking complicated. I've managed to make a few baby steps towards finishing my project, but I've hit a brick wall and could use a few of your beautiful ...
0
votes
1answer
44 views

Check if raycast is hitting object

I am using the following which is attached on to an enemy, when I press the fire button it lowers the health of that enemy, my problem is HOW do I know if I am actually hitting the game object this ...
2
votes
1answer
96 views

Webgl page heap size increasing in each page load then crash

I am getting aw snap or sometime not enough memory problem when I reload my webgl page. I have a webgl project which is empty (just a camera + light), developed in unity3d. I am reloading it, and ...
0
votes
1answer
17 views

Unity3D - Finding every subclass of monobehaviour in current project with reflection

I am trying to find all types that inherit from monobehaviour inside my Unity project. So not the instances of them but the actual types in the assembly. I've tried this little piece of code and I don'...
1
vote
1answer
33 views

Black screen when building apk Unity

Alright, I have a bit of a confession to make: I accidentally posted this question in the wrong place: Stack Overflow. Whoops. Anyway, here's my problem. Sorry if you've seen this before. Here's the ...
0
votes
2answers
61 views

How to avoid enemies overlapping each other when chasing player in Unity?

I am trying to get enemies to chase player but without them overlapping each other when they get closer to the player. So far what I have is that I check for the distance between current enemy and ...
1
vote
1answer
10 views

How do I parent an object to a bone in the blender hierarchy?

So, I'm trying to make a simple RPG game using Blender and Unity. I would like to have an empty object to be used as a weapon holding position parented to my right hand bone so that I can switch ...
0
votes
1answer
30 views

Unity Rendering (Bug): Objects rendered as multiple instances after repositioning

Context: I am currently making the menu for my game demo. It involoves "Raindrop"-Gameobjects (Sprites) being repositoned and recolored after a random amount of time. I do this by instantiating a ...
0
votes
1answer
38 views

Unity Android build fails, error : Could not find com.android.tools.build:gradle:x.x.x

Can't build for Android, error log: CommandInvokationFailure: Gradle build failed, And this is in it's description: ...
0
votes
2answers
33 views

Changing animator via scriping

I am using the following code, my intention is whenever the 2 objects meet the animator boolean changes and when leave change back to its original setting. But it doesnt seem to work. ...
0
votes
2answers
93 views

What method could I use to avoid using a lookup table for each item when loading a players inventory?

Let me explain a little about the pickup items and inventory to make this much clearer. Every in world item that can be picked up has a ScriptableObject assigned ...
0
votes
0answers
41 views

Staying in loop rather than keep executing

I am using the following code, which makes the game object look at me, walk towards me and then I change the boolean on the animation to perform an attack animation, the attack animation occurs on ...
0
votes
1answer
33 views

How do you write an unlit shader which supports Ambient Occlusion?

For performance reasons, a scene might use Unlit shaders only. Is there an Unlit shader which supports Ambient Occlusion? What is the best way to achieve this look, for moving and static objects, ...
0
votes
0answers
50 views

Voxel terrain generation performance problems

I am trying to create a minecraft clone to practice some stuff in Unity including Raycasting, terrain generation and player controlls. Terrain is generating without any problem with a perlinNoise. ...