Category "unity3d"

Unity: Generic Method to get or add a component

Every time I make a new Script in Unity, I always end up doing a bunch of checks for any components my script depends on, like: SpriteRenderer sr = gameObject.

Json.NET in Unity throwing 'The type or namespace `Newtonsoft` could not be found'

I used nuget to install Json.NET into my Unity project but the issue is when I launch it throws The type or namespace 'Newtonsoft' could not be found. Are you m

Json.NET in Unity throwing 'The type or namespace `Newtonsoft` could not be found'

I used nuget to install Json.NET into my Unity project but the issue is when I launch it throws The type or namespace 'Newtonsoft' could not be found. Are you m

Programming Unity Games with Ruby

So I see that unity has the support for c#, JS and Boo. I could learn one of these but I would like to make a 'compiler' or something similar that would let me

if Unity will include the chunk of code in apk if I write it in "UNITY_EDITOR"

Example: If I write following code in a Script file. #if UNITY_EDITOR Debug.Log( "I'll print in Editor only.." ); #endif My question is that when creating

How to manually change variables on custom window editor and make it it persistent?

I'm trying to create a custom editor window in Unity that make me able to generate "things". When I open my custom window I want a list (and of course other var

Unity input is not working, how to fix it?

this is my script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { // Start is called

MRTK Photon Unity Networking 'AnchorModuleScript' namespace not found

While following the mrtk tutorial on multi-user capabilities, there has been one CS0246 error that I haven't been able to avoid. After importing PUN 2 from the

3d unity c# car reverse direction movement

I need some help in moving my player car in the reverse direction in unity C# scripting. The forward movement is perfect but the reverse movement is totally opp

How to unsubscribe from an event inside of the gamemanager?

In my GameManager script I have a delegate. In my Door script, I subscribe to this delegate. I've tried unsubscribing from it in both the OnDisable and OnDestro

Audio not playing in Unity

I am trying to program a script that when you hit an enemy it plays a sound, problem is I can't get it to play the sound it sees the audio source but my script

How to place multiple spatial anchors and set up path finding in Unity for HoloLens?

I want to place multiple azure anchors and set up pathfinding (like destination point ). I followed the (https://docs.microsoft.com/en-us/azure/spatial-anchors/

What does #pragma vertex vert_img do in a Unity shader?

While I built an idea of what vert_img does by observing results, I would like to read a more theoretical explanation that I couldn't find online. For context,

Awake() and Start()

I see that we can initialize Variable in Awake() or Start() and Awake() will be called before Start(). When should we initialize in Awake and Start to have th

Check for internet connectivity from Unity

I have a Unity project which I build for Android and iOS platforms. I want to check for internet connectivity on Desktop, Android, and iOS devices. I've read ab

QR Scanner won't work on iOS devices (Unity)

Please let me start off by saying I have only been programming for about 2 years now. I am somewhat new to it. I am also more of an Android developer than an Ap

Picking video file on Android 10: Error NdkMediaExtractor can't create HTTP service

I'm using Unity version 2019.4.3f1 I'm trying to load local video file on Android 10 device (Samsung A90) from the gallery but I'm not able getting this error:

Changing the default tag in Debug.Log for Unity 3D

In order to debug the code for android tags are very helpful to filters the logs on the basis of tags. In Unity 3d when we use Debug.Log By defaults all log

Unity3D: Detect if mouse has clicked on a UI element?

This is a pretty simple question, but it seems something has changed on Unity in the last versions answers I've found on the internet are no longer valid, so he

In Unity, how to detect if window is being resized and if window has stopped resizing

I wanted my UI to not resize when user is still resizing the game (holding click in the window border) and only when the user has released the mouse the resize