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

Can Inspector interactions be used with UNET

SyncVar and RPC calls allow a UNET server to send messages to clients, but these messages are not triggered if the server-side change comes from the inspector or a custom editor (and presumably any ...
0
votes
1answer
38 views

Stop movement if transform.position.y == 0

Why does the following code not step the object's movement when its y coordinate reaches zero? ...
0
votes
2answers
34 views

Manual collision detection with a Box Collider 2D

My game is turn-based, so I only need collision to be detected after a specific game event has occurred, so for instance after every PlayerMoveComplete event. I could just define a MonoBehaviour ...
0
votes
1answer
45 views

how to set multiple materials using array in the submesh of an object

I'm trying to insert multiple materials into the object's submesh using the array, but I'm not getting public GameObject[] obj; ...
0
votes
0answers
49 views

Blender / Unity - Which one do I paint on? low poly or high poly

I created two versions of my object. One high poly and one low poly. I sculpted the high poly one and plan on baking a normal map so that my low poly one can have more detail. My question is, once ...
0
votes
1answer
41 views

Transform inputs don't work

I'm writing a C# player script for a class and when I run, the sound inputs work fine, but the movement inputs don't respond, and I don't know how to fix it. Code: ...
-1
votes
0answers
18 views

Object reference not set to an instance of an object [duplicate]

I'm writing a script for a game object, but I'm get an error message saying 'Object reference not set to an instance of an object', and it makes all my inputs stop working. Code: ...
0
votes
1answer
19 views

PostFX2 Custom Effect's Y position has wrong offset ONLY in GAME camera. Scene camera is OK

I implemented raymarching in a full-screen Post FX2 custom effect. Let's say I'm rendering a SDF sphere at world coordinates 0, 0, 0. Everything is fine in the scene camera -- if I rotate the camera ...
1
vote
1answer
33 views

How to access Lit shader properties through code?

Currently i'm using HDRP in my project, so i have a question. How can i access Lit shader properties through code ? Or where i can see names of variables in this shader ? For example:
0
votes
0answers
19 views

How to make selectable method dropdown on inspector

Something like Animation Event's inspector: but only specific static class and static methods will be shown. UnityEvent will show something like this: But I ...
0
votes
1answer
49 views

How can I create a tunnel/parallax/depth effect based on mobile device tilting?

I would like to create applications similar to what's displayed in these videos: VR Tunnel Live Wallpaper for Android The parallax view Part 1 These mobile application are supposed to react to ...
0
votes
0answers
14 views

GameObject transform localPosition not setting when you use a function to set somewhere else in the code

So z position on some gameObject being generated from a prefab was being set wrong. I create to function to do like a reset transform thing, but when I set the localPosition in the function it does ...
3
votes
1answer
74 views

Why does my collider rotate correctly on a slope only when a ray is cast directly from its center?

Edit: This answer might also be helpful to those who come across this question. I've been messing around with raycast collisions and slopes, but am having an issue when trying to get my collider to ...
1
vote
2answers
122 views

Why are my waves not spawning as expected?

Hey guys so here's an outline of my problem using a basic 3-step approach The Problem Defined Waves 1-22 should spawn in order with the correct paths and enemy prefabs. However, Waves 1-4 only spawn ...
0
votes
0answers
13 views

IK Elbow not working?

I'm trying to make character elbow movable like the hand. In my case, is not moving at all. Is it from my script or something else ? ...
1
vote
1answer
35 views

how do I set an int to the scroll wheel data in unity

i need to set an int to data from the scroll wheel so I can have the script use this int to display an item attached to a number from that int. i'm using c# i set up my scroll wheel input, what am i ...
1
vote
0answers
23 views

Discrete line inside a 3D matrix

First of all a little premise: I'm following this tutorial on YouTube for procedural 2d cave generation in unity using cellular automata and I'm extending it in order to make caves in all three ...
0
votes
1answer
35 views

Why is my ad not showing?

My ad does not appear. I want to click the button and have an ad appear. ...
0
votes
0answers
43 views

why are my 2d game objects passing through each other?

So I've been looking around for a while and can't seem to find an answer for this. I am trying to make a game where you stack shapes as high as possible. I have an OnMouseDrag script so I can grab a ...
1
vote
1answer
94 views

How can I create good looking football field lines?

I am trying to create a football field in a countryside with correct measurements of the lines. It's for my first person game. I have a terrain with mountains, trees, etc. and a flat surface for the ...
0
votes
0answers
23 views

Unity sizeDelta of an Image update opposite to what it should

I have an IEnumerator coroutine in which I call the UIManager script to update the Image size to fit the text size but it doesn't happen. when I use yield return new WaitForEndOfFrame() it sometimes ...
0
votes
0answers
33 views

How to increase or decrease the speed of a gameObject after solving a puzzle?

I am new to unity development and I am trying to make a script where the game player needs to solve puzzles to keep an object moving. How can I make the player increase/decrease this velocity after ...
0
votes
0answers
18 views

Easily get several materials from different objects onto 1 UV map/material?

Im trying to improve performance, and I found an asset called https://forum.unity.com/threads/one-batch-combine-hundreds-of-materials-into-one-draw-call.555643/ that claims to do what I need - which ...
0
votes
1answer
44 views

Visual Studio can't handle my unity scripts

I have created a new project in Unity 2018.3.4f1 with Visual Studio Community 2017. I can't edit scripts properly in Visual Studio because of a bunch of errors related to .net framework. How can I fix ...
1
vote
1answer
29 views

Create context menu in Scene view

I created some MenuItemfunctions for navigating, which are currently displayed on the menu toolbar. The C# code: ...
1
vote
2answers
59 views

Recursively calculate possible pathway on a grid depending on max walk distance

I have a character that is placed on a grid. It has a variable maximum walking distance. Grid fields can be walkable or not walkable. As the character may has to walk around certain not walkable ...
1
vote
2answers
45 views

Null Reference Exception error occurs when trying to override AndroidManifest file in unity?

So I Created A manifest file in Assets/Plugin/Android/. The File contains: ...
2
votes
1answer
45 views

How can I change view to orthographic using a menu?

I'm writing the custom menu using MenuItem and I'm stuck trying to make scene view orthographic when 5 is pressed. What is the ...
2
votes
1answer
74 views

How can I create color fonts to be used in Unity?

I've been searching, downloaded a couple programs that lets you convert images into fonts, but none let you obtain the color. They all switch them to black and white. While searching the internet, I ...
1
vote
2answers
64 views

How to achieve a stable hover in Unity

In the game that I am currently making the play character is supposed to hover off the ground. I had used the code from the Hover Car tutorial on the unity website however this causes a lot of ...
0
votes
1answer
37 views

Unity websockets client disconnects after server emits with data

I am using some unity "socket-io" plugin i found on the asset store. (its essentially just a scoket.io wrapper for websocket-sharp) everything works absolutely fine, i can catch clients connecting or ...
1
vote
1answer
62 views

Morphing a 3D model into a sphere or cube using a vertex shader

I want to morph between 3d models.I found a simple OpenGL code to morphing In Graphics Shaders: Theory and Practice(page 456) but I couldn't Implement it correctly in unity. ...
0
votes
1answer
44 views
0
votes
1answer
74 views

Manage massive items game data in an Android Idle Game

I'm working on an Android Idle game, with many items that user can buy in each level, that each of them has more than 50 levels who can be updated by the user. Each item in each specific level can ...
0
votes
0answers
22 views

Unity — Proper algorithm for a Character Controller that automatically fits mesh?

I'm trying to make an algorithm that will automatically generate a CharacterController component (on a parent-GameObject) which should automatically resize to whatever the current mesh size is. To ...
0
votes
0answers
47 views

How to drag an object with mouse with collision?

I want to drag a GameObject with the mouse but I need collision. The basic mouse dragging code simply sets the position of the object to the hit.point with an ...
2
votes
1answer
70 views

Cannot assign values to variables (?)

I wouldn't say i'm new to unity or programming in general.. but right now i feel so stupid. I have a simple enemy script. I instantiate object with another script, calling SettingUpCreep and giving ...
2
votes
1answer
50 views

How do I render a cylindrical world space onto a flat, 2D view port in Unity?

The question is just a logical extension of this question. So, how should I render a cylindrical world space onto a flat, 2D view port in Unity? Thank you.
4
votes
1answer
98 views

How can I find the distance from bezier curve anchor points to control points for a circle approximation and their positions

From the image below, I have represented a circle by a closed bezier curve made of two cubic bezier segments. I am aware that a bezier curve cannot represent a perfect circle. How can I calculate the ...
0
votes
1answer
58 views

How do I compile a namespace to a .DLL in Unity?

I'm developing a core library that I will use in my other games. I've only heard of using Unity .DLLs recently, and have spent some time putting my core scripts into a namespace. If I understand .DLLs ...
0
votes
0answers
36 views

how do I instantiate a prefab that adds to the score text in c#?

Hello I'm working on a game with random generation, a dungeon crawler of sorts. i need to be able to have an object that when instantiated, adds to the score(the goal is to find all of them as the ...
1
vote
1answer
57 views

How can I disable Unity's default cursor functionality?

Not too sure how to ask this, I'll try my best. Currently, I'm working on a First-Person Controller. I'm adding functionality for a pause menu so that when you press escape, it will open the pause ...
0
votes
0answers
15 views

How to customize sliders in Unity3D

I would like to customize a slider in Unity3D but don't know how to accomplish this. I want to change the border (i.e. the thickness and color) of the slider. How do I change the corners? Also I ...
-1
votes
0answers
41 views

Using a Singleton for an EditorWindow

I am trying to create my custom EditorWindow in Unity, using a Singleton structure for logic between Editor scripts What is the proper way of creating Singleton in EditorWindow structure? Maybe ...
0
votes
0answers
19 views

Unity Erase Image from mouse pointer

I want to erase the image for mouse pointer in unity. My pointer should be as a eraser. What is I do create the eraser? My sprite is always change because it provide from the server. Please help me.
0
votes
0answers
25 views

Need Root Motion For Gravity, But It Affects Rotation?

I have a little animated character in my game with multiple animations. In order to have gravity affect him, I turned on "Apply Root Motion" in his animator. Now one of his animations won't rotate ...
0
votes
2answers
38 views

FoV value scaling

I'm creating an FPS project in Unity 2018. My reference FoV is 90. Let's say I'd like to create an sniper rifle which let player change FoV to 60 when he's aiming with optics. But what should be the ...
5
votes
1answer
257 views

How to Implement a Very Simple Game State Manager in Unity?

I’ve tried a bunch of different implementations, and trawled everything online I could get my hands on. Everything has downsides, nothing plays nicely with how Unity wants you to work. Let’s keep it ...
0
votes
0answers
22 views

Unity Blender Android Parallax App

so my question is: from a 3D object made in a blender, let's say a tunnel that i would like to loop or stop it. i would like to get a parallax effect from it. when the gyroscope of the end of this ...
1
vote
1answer
26 views

Tell Unity to use a certain LayerMask to raise or not OnDrop (for a class that implements IDropHandler)

I am trying to make a draggable GameObject that can be dropped within a container but when i'm releasing the mouse button even though the mouse is over the container (and the dragged object too) ...