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.

1
vote
2answers
401 views

Unity build error “Value cannot be null. Parameter name: path1”

I'm getting this error when trying to build my game for Android, I've googled it but there's only 1 result about it and it didn't work for me as I use 64-bit windows. How can I fix this and what's ...
0
votes
1answer
199 views

Name doesn't exist in current context in Unity

I'm currently making a collectible heart in unity, the kind that updates your health bar when you collide with it, and I made two scripts: This one is called 'healthmonitor': ...
0
votes
2answers
82 views

Limit Color Pallete Using Shader (Unity)

Basically, what I want to do is take a primary input image texture (which is a render texture in-game) and a secondary pallete texture (contains X number of colors, and is X by 1 pixels in size). What ...
0
votes
0answers
22 views

How to create Simple Click multiplayer test Game with photon

I am trying to create a simple multiplayer test sample with unity and photon but unable to do so. I am watching the tutorial and reading for 2 days. Now I know how to connect the player to a server ...
0
votes
1answer
18 views

Remove or change graphic of InputField target graphic

I am working on a game in Unity and I have to use an InputField but I would like it to not have a border. Currently it has a black border with a border radius that needs to go. Through my initial ...
0
votes
1answer
31 views

Reading data from files in Unity on Android

I have successfully read in and written level data using .dat files on unity PC builds, but compiling for android stops me from being able to read in information from the resources folder. I was under ...
0
votes
4answers
4k views

How do I make my Unity application quit programmatically?

I made a script and I want to make my game quit, but this does not work. How should I go to make the app quit? ...
0
votes
1answer
756 views

How to design prefabs in Entity Component Systems

In Unity (and I presume other game engines) you can create "prefabs" which are blueprints for game objects. They contain a list of components, and default values for those components. Prefabs can be ...
0
votes
1answer
38 views

Ubuntu-Unity3D All Compiler Errors Problem

Before 2 weeks ago I can develop games on Ubuntu with Unity3D but after some updates or somethings I give "all compiler errors have to be fixed before you can enter play mode" messages. If I compile ...
1
vote
1answer
32 views

Custom inspectors cropped since 2019.1

Since updating to 2019.1, I have noticed that my custom editors are not drawing properly. It is kinda like they were being cropped, for some reason. Here is an example: ...
1
vote
1answer
27 views

Unity - I can't change the “colorOverLifetime” property of the “Particle System” via script

The goal is to remove the particles via script with fade effect. But I'm not just interested in an alternative, I want to understand why my code doesn't work. The code below is modified to show only ...
0
votes
1answer
50 views

How to connect to a server without hard coded passwords?

I have two features in my game that need to a server of some kind that require authentication: a bug reporter and a leaderboard. The bug reporter will take the users report and add it as a card to my ...
0
votes
1answer
13 views

Multiplayer first person camera gone after restart

I have a main camera in a multiplayer scene and when a player joins he owns that camera so there is always a single camera. Now when i click "disconnect" and connect again, there is no camera left in ...
0
votes
1answer
53 views

How to make a proper release build - Unity Android - x86, ARM32, ARM64

I'm trying to create a release on Google Play. I currently have Build App Bundle checked in the build settings, and it helps decrease the build size. In player ...
0
votes
1answer
20 views

Bullet is not instantiating properly in Unity

So I'm trying to make a simple weapon where I just instantiate a bullet at the Shoot Point's gameobject position. For some reason when I press down on my mouse the bullet just flies up. Any ideas on ...
2
votes
2answers
8k views

How to force keep the aspect ratio and specific resolution without stretching the output screen view?

I'm using Screen.SetResolution() But when I run in Android device, it shows the output image is stretched to fill up the full screen which I don't want. I want it to keep the aspect ratio properly. ...
0
votes
1answer
28 views

Why is Camera turning with different speed than Player with same code in different scripts? (with unity)

I want to integrate a running character in my game, so I downloaded the animation via Mixamo. The player is running and if I attach the camera directly to the Player it's shaking the camera and the ...
0
votes
1answer
30 views

Why are my records duplicated when writing them to a file?

I am writing data to a file every two seconds. I used InvokeRepeating and everything is Ok except that every record is saved 3 times in the file: ...
0
votes
1answer
30 views

How to change Texture2D type to Sprite during runtime (Unity)

How can we convert the Texture2D type to "Sprite" using the script (not in Editor)? It seems that the Texture2D retrieved from file is by default Normal Map. I need to convert the TextureType to "...
0
votes
1answer
25 views

Unity - adding camera constraint to prevent the player from seeing beyond the scene

Like the title says, I'm after some kind of constraint for the camera to prevent the player from seeing beyond the scene and seeing the Skybox. I came across the code to add a ...
0
votes
2answers
55 views

Problem picking up a value, Delegate

I'm having trouble passing values that are inside an int function to an onclick delegate. this script causes the object to move in vector3 (-1 to the left and 1 to the right), these two values are ...
1
vote
1answer
25 views

How to upgrade a project in Unity Hub

Before Unity Hub, it used to be the case that if you opened up a project that was from an older version, you would be prompted to upgrade the project. I am now on the latest Unity Hub 2.0.0 and I am ...
1
vote
1answer
50 views

Multi-level 3D grid based pathfinding in Unity

I'm trying to come up with a way to pathfind on multiple levels. See image: The orange walls would be considered a ladder, connecting you to the upper levels. At first I thought of looking at it as ...
0
votes
1answer
41 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
1answer
50 views

Various unreproducible crashes caused by asset bundles

We recently released a game on iOS and Android, and a bunch of crash reports have started coming in on iOS through Crashlytics that appear to be due to problems with shaders in asset bundles and other ...
0
votes
1answer
27 views

VS2017 (and 2019) Community Intellisense only showing part of the Unity class/method information, missing descriptions

If I hover keywords like Input.GetKeyDown, for example, I know it should tell me something about using it for autofire. I get autocompletion and the syntax ...
0
votes
0answers
32 views

LWRP Custom Shader Graph material casts no shadow

I created an empty Shader Graph by clicking Create -> Shaders -> PBR Graph. I created the material for this shader and assigned it to my game object, but the object does not cast a shadow. If I ...
0
votes
1answer
163 views

Unity 2D UI Scrollview Stretch settings not staying

So I'm trying to make a Scrollviewer and inside that will be aload of boxes stacked on top of each other (the boxes have information in them - like the boxes in this screenshot here but they will ...
0
votes
2answers
30 views

Convert Kafka Thread related code example into Unity3d

I have code snippet of Kafka Consumer which i have developed with the help of this and here it is: ...
0
votes
1answer
15 views

Bullet Projectile Verticle Rotation

I'm very new to C# and Unity, and have been working on a projectile based weapon, and for the most part it's been working well. However, although the bullet fires facing the direction it's being shot ...
0
votes
1answer
34 views

Should my terrain be one big mesh or several medium ones?

While creating a subterranean level with probuilder (irregularly shaped rooms and corridors), I was wondering if I should merge all "terrain" meshes into one or keep them as separate meshes? What are ...
0
votes
0answers
13 views

How to calculate Admob Revenue? [duplicate]

Let's say you have a game called "X" This game has 1.000 daily users and let's say all of them watches only 1 rewarded video. How can you calculate your revenue according to this? Do you get your ...
0
votes
1answer
941 views

Adding Google IAP License Key into Unity Games

I have added Google Play Services and AdMob successfully into my app. But I want an in-app purchase button that lets you remove the adverts. (I have the button already but not the billing). Google ...
1
vote
1answer
227 views

Issue implementing wall jump in Unity

I'm having troubles implementing a satisfying wall jump in Unity. I managed to detect collision with a wall, but when I press the jump button, the result is alway weird or very weak. I think this have ...
1
vote
1answer
18 views

What is the purpose of the Allocation Callstacks button in Unity's Profile window?

I have an idea of what this button does, but I cannot find any specific information in the documentation. What information does this button add to the profiling data? How can I see this extra ...
0
votes
0answers
20 views

Unity Client and Multiplayer Networking/Architecture

My background is in Enterprise and SaaS web infrastructure. Zero information about games and how their networking works. I only know about the world of browsers and RESTful APIs. I'm planning on ...
0
votes
0answers
21 views

Low Res Atlas Texture vs. Many different materials without textures

So I have recently started to look into optimizing a medium complex 3D scene, more specifically i am looking to improve the performance i get from a fairly realistic bus. I am currently using the ...
0
votes
1answer
29 views

Emotiv Epoc integration with Unity

I'm coding a small game on Unity to control with the Emotiv Epoc headset. However, as I'm new to Unity, I'm having some trouble setting everything up to connect the device with my game. I downloaded ...
0
votes
0answers
17 views

How batching works in LWRP?

In LWRP do objects need to have the same mesh in order to be batched? I am asking because I have not found such condition in the docs strangely.
0
votes
4answers
5k views

How to disable script component while in game?

I'm trying to make a C# script to disable the First person controller script component for my character. I'm doing this so that while I'm controlling something else such as a vehicle, the only control ...
0
votes
1answer
36 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
1answer
46 views

Applying Y offset to rotation / position script

I'm using the script stated below to move a spray bottle around a head. The code works fine: I have assigned the script to the spray bottle, and I have set the head as the target. However, I was ...
0
votes
1answer
2k views

Using ShaderGraph for UI elements with transparency

I am trying to design some UI elements using shader graph. In this case specifically a lifebar that is transparent where empty. For a normal lifebar with a filled and empty color I got it working ...
1
vote
2answers
1k views

Hold touch at the screen to move object

I'm using unity2D and C#, and I have a code for touch screen: ...
0
votes
0answers
22 views

Make players Rigibody move in direction its going?

I have my snowboard character which I am trying to fix the movement for. At the moment, The player is using transform.forward on the rigidbody to move forward. If my player turns around and faces up ...
0
votes
0answers
23 views

How can I put an expandable UI element inside a Vertical Layout Group and make everything expand to fit its content?

I found this tutorial on how to build an expandable "accordion"-style UI element, but it doesn't seem to deal well with dynamic resizing. If I put a Vertical Layout Group inside the collapsible body, ...
0
votes
1answer
26 views

Can't control smoothness in Simple Lit

Smoothness slider is not active. Why and how to make it active?
0
votes
0answers
29 views

How can I reduce the size of a png in unity while maintaining picture quality

I'm new to Unity. I'm using Unity 2019.1.3f1 Personal. My issue is that I have created pictures (png) of a character in Photoshop. The picture borders look clean in Photoshop and looks okay, not ...
0
votes
1answer
41 views

Resize game object using single drag handle using Unity

Really need your help. I'm trying to create a custom controller for my app to allow users to resize and rotate game objects using a single drag object. I was able to create the code to create the ...
0
votes
1answer
19 views

Get rotation of camera in Google VR

I'm trying to move child of camera object smooth. To implement that, I need to know the movement of x and y axis, like Input.GetAxis in general PC platforms. I saw the documentation and examples of ...