76,993 questions
1 vote
1 answer
103 views
VS Code doesn't Recognize Unity Classes
For two days now, I've been having a rather strange problem. The MonoBehaviour class isn't recognized by VS Code, with the following error: Error while loading [...]: Exception thrown: System....
2 votes
6 answers
6k views
I am not able to build android app in Unity3D. Error Gradle initialization failed
I am using an empty Unity Android project. I am not able to build APK since 2 weeks. I am getting this error CommandWithNoStdoutInvokationFailure: Gradle initialization failed. UnityEditor.Android....
26 votes
4 answers
10k views
Why does C# null-conditional operator not work with UnityEngine.Object?
I've noticed that if I have some variables exposed to the Unity inspector such as: [SerializeField] GameObject _tickIcon; If I leave them unassigned and try to use the null conditional operator and ...
-1 votes
2 answers
606 views
GameObject in class?
I'm in the middle of a Tower Defense - style developing in Unity using C#. So, I have an abstract class for the towers that has an int for the range, the rate of fire, etc. And then I have a few child ...
0 votes
0 answers
36 views
Unity - Libraries of ARM64 not supporting 16 KB page size
I’m currently testing my Unity project for Android 15 compliance (Google Play requirement for 16 KB memory page sizes). After upgrading to Unity 6000.0.62f1 (which claims to support 16 KB page size by ...
0 votes
1 answer
68 views
Prefab type mismatch
I have tried for days to troubleshoot but only met with persisting Type Mismatch. I am working on a flappy bird game and i wanted to make the pipes go faster as the score increases so i made a [...
2 votes
4 answers
3k views
Receiving "USE_AUTH_EMULATOR not set." message
My old project gave me this error after I change my system to apple m1 . USE_AUTH_EMULATOR not set. when I use "SignInWithEmailAndPasswordAsync" func, immediately I get "...
0 votes
1 answer
8k views
Unity NullReferenceException Error w/ New Input System
I'm pretty new to unity so I'm sorry if this is an easy fix, but I can't figure it out. I'm getting a null error something to do with my playerInputHandler. Could someone point out where I'm going ...
0 votes
0 answers
39 views
Google Signin with AWS Cognito
Our games built using Unity, use Google Play Games Services v1 to support Google Signin. Once the player is signed in, token is obtained using: token = PlayGamesPlatform.Instance.GetIdToken(); and ...
1 vote
2 answers
72 views
Unity gameobject destroyed and returns "null" but still returns "obj == null" as false
I have a class for lists called UniqueListWithActions<T> with the constructor method public UniqueListWithActions(List<T> _list) { list = _list; } list is declared as ...
2 votes
1 answer
9k views
Using Zenject to inject an implementation with interfaces
I'm trying to use Zenject in Unity. I have an interface and several implementations of it. I want to inject with ID but also that the implementation will have the tick interface since it's not a ...
30 votes
14 answers
118k views
Unity UI button not reacting to clicks or hovering
I'm using Unity 3D's new UI system to build a pause menu for my game. Currently I'm trying to have my buttons respond to mouse clicks. Some of my hierarchy is as follows: When I click on one of my ...
1 vote
2 answers
118 views
List of weapons that use own variable
Iteration of every variable in the foreach is not assigned to the weapon iterated. public class CharacterAttack : MonoBehaviour { #region Fields private Weapon weapon; public List<...
Best practices
1 vote
2 replies
47 views
Finite State Machine for different enemies
I’d like to ask about best practices for using a finite state machine to handle different enemy behaviors. I already created a state machine for my basic enemies with the following behavior: ...
1 vote
2 answers
1k views
How to set Unity3D vertical camera rotation limit
I want to rotate my camera horizontally around the object 360 degree and I want to limit my vertical rotation from -45 to 45 degrees. I have found some solution over internet but none of them are ...