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
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
1answer
38 views

Weird behavior using TextMeshPro

I have a very simple scene setup. What I want to do is to create a button prefab composed of a sprite and a TextMeshPro object. When I group the sprite and the text under a GameObject, the pivot of ...
0
votes
0answers
20 views

For a serious game, which is the best software testing methodology? [on hold]

About my game: Is a top down puzzle / escape room type of game. From my own research I have found: https://en.wikipedia.org/wiki/Game_testing#Methodology http://bsigroup.com (Software testing ...
0
votes
1answer
638 views

Socketio, nodejs. syncing movement with rigidbodies over the network - unity

I am building a 2d top-down mmo. very lightweight. I have a master client that determines everythings position, and actions and send this information to all other clients. Now I have made a great ...
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
0answers
14 views

NullReferenceException: Object reference not set to an instance of an object on boolean variable from separate class [duplicate]

I'm trying to develop game scenario that able to trigger the alarm with alarm light and siren audio to play. For the testing purpose I set it that to boolean value as "alarmOn" in AlarmLight class. <...
0
votes
1answer
36 views

SerialPort() data reading slowing down Unity

I am sending a few data from Arduino Uno to Unity using serial Port, baud rate is 115200. Still Unity is response time is pretty poor. At first it takes fraction ...
4
votes
2answers
3k views

Can't clip a sprite that has a custom shader in NGUI

I am using NGUI. I have an "NGUI Unity 2D Sprite". This sprite has a material with this shader: ...
0
votes
1answer
38 views

How to stop Objects with Rigidbodies from explosion when dragging

I have a sequence of capsules linked with fixed join and each capsule have a Rigidbody and a cube collider (the picture bellow shows how it's look like) and this ...
0
votes
0answers
27 views

How to do lighting for endless runner game?

I have been working on a endless runner game for a month now and have to do basic lighting. In my game Player moves forward and world is being generated according to player position. So the positions ...
0
votes
0answers
10 views

How can I repeat the texture horizontally by N times?

I have a problem that is rather simple to explain but for which I haven't found a simple fix for so far! Take the following texture: I've generated a quad out of it and obviously it looks the ...
0
votes
1answer
719 views

How to instantiate GameObject on client without network?

When I NetworkServer.Spawn(ob) a gameobject and make it a child of a transform.parent after it spawns on both the server and ...
1
vote
1answer
21 views

Why does my Unity C# List not load from FromJSON()?

I'm using Unity and trying to load in data from JSON files. It finds the files, but no data comes through. when I do a Debug.Log(count) on it it tells me there are zero entries. But the same code for ...
0
votes
1answer
419 views

Unity Ambient Occlusion not working with Orthographic camera

It seems like the Ambient Occlusion setting from the Unity Post Processing stack (obtained from the asset store) only works with a Perspective camera, yet I haven't ...
4
votes
1answer
281 views

Show Unity Line Renderer as 3d cable or wire

I am dynamically making a line renderer which is pull by the character to show that a character is pulling a wire. The line renderer working fine but unfortunately its display is not according to my ...
0
votes
0answers
7 views

Unity - How to use instanced properties of a shader?

I just want a simple effect such that on every object using the same material, the texture has different uv offsets, while keeping them batched in one draw call. By my understanding I first tried to ...
0
votes
0answers
16 views

how to detect Unity UNET errors?

I'm working on a simple multiplayer online game. and I use UNET and Networkmanager. In my game I have some rooms and players ...
0
votes
1answer
32 views

How to make a rigidbody come to rest faster

I'm trying to move around a 3D rigidbody in Unity 2018.1.0f2 Personal. I am using a C# script with the basic vector3 and velocity stuff from a YouTube video: ...
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 ...
0
votes
2answers
53 views

Can I replace the source image of slices by script?

I have a Unity2D prefab that uses several slices from a single PNG. (in it sprite renderer, and in its animation clips). If I replace that PNG in the Finder, all slices taken from that PNG are ...
0
votes
0answers
9 views

Unity2D TileMap Collider Update Optimization

I'm currently working on a 2D tile-based side-scroller (similar to Terraria). I am using Unity's TileMap feature to draw tiles onto the screen and have my player collide with them as if they were ...
3
votes
1answer
2k views

Global fog does not work with deferred rendering in Unity

When I set deferred rendering the global fog from the Unity Standard Assets does not work, there is no fog at all. With forward rendering the global fog works. How do I add fog with deferred rendering?...
1
vote
3answers
677 views
2
votes
1answer
2k views

Unity 5 Networking Send Rate: Send Rate is Zero but server movement is still happening

I have a client server scenario, just a player moving about on the client and he moves about on the server using the built in networking provided in Unity 5. I have my client scene running in the ...
0
votes
0answers
21 views

specific function of class Time

Is there a function that according to the name of the object, its tag and the time taken since the beginning of the game(for example time+=Time.deltaTime), gives the position of this object? if yes ...
0
votes
1answer
18 views

Comparing performance

I wanted to create a portal. This portal looks like a semi-transparent texture rotating on a cylinder: At first I created such a portal using a Particle System. Then I realized that this might be an ...
1
vote
1answer
205 views

Animation Dilemma: How to create authentic discontinuous block-like character movement

I am using Unity. I have quite a bit of Unity experience, however I am a novice in animation. In the past I have had someone else do character Animation aside from some Camera animation and simple ...
0
votes
0answers
22 views

How to let a gun follow the camera while characters hands are following the gun

I have made a character using MakeHuman, imported to blender and created a view animations. Then I imported the character as .fbx file into Unity. I set up an FPS scene with a player holding a gun in ...
0
votes
0answers
28 views

Particle System location

I have created a particle system. In this particle system, I'm using a cylinder as a mesh. It looks as I want it to, but its location is really strange: In this screenshot one can see that in the ...
0
votes
1answer
43 views

Dividing Data and Logic in Unity

I am currently working on a small side project (as usual), and trying to build up from previous experiences. I have the following elements in the game: 1) Region: ...
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 ...
1
vote
2answers
60 views

OnMouseDown() execute only once

I have the following OnMouseDown() function: ...
0
votes
1answer
10 views

Culling mask don't work

I have the following setup: MainCamera render everything except ImageTurret layer. TurretCamera render only ImageTurret layer on a RawImage My problem is: MainCamera render everything and ...
0
votes
1answer
25 views

Attaching a swinging object to a rolling object?

I am new to Unity and attempting to create a platform that hangs down under a roller that runs on rails. I've gathered my objects and come so far but I can't for the life of me work out how to attach ...
0
votes
1answer
63 views

instantiate with arrays of objects and transforms

Instead of using a list, I want to use a two-dimensional array of objects and a two-dimensional array of transforms. But instantiations do not work with this code in C sharp: ...
2
votes
1answer
920 views

Unity 5.x Network Synchronization Concepts

Bear with me, It will be long read^^ I am working on the new Unity Networking system. I was using Photon and old (legacy) unity network API's before. But as it seems there are some good benefits of ...
0
votes
1answer
98 views

Unity3D: activeSelf issues

I've been trying to script some basic AI for a Unity Roll-A-Ball game, which involves two balls collecting cubes for points (one controlled by the player and the other controlled by AI. Everything ...
3
votes
2answers
2k views

Making a dialog that expands to fit its text

I'm trying to make an OK/Cancel-style dialog which will expand to fit its text in Unity 5.6. I've been trying to pull this off using Unity's built-in UI layout components, but so far I haven't been ...
0
votes
0answers
13 views

How to fix Unity 2D Android app runs well in editor but not on devices or emulators? [duplicate]

I am developing an Android game with Unity 2D, build 2018.3 personal edition. I have set base Android version to 14 and target version to latest. There are two scenes and Admob plugin installed. The ...
0
votes
0answers
13 views

How to draw lines or draw lines between objects through touch?

I'm working in unity and in one of the activities I have to generate different vertex and the player would have to be able to squeeze an object and move the finger to another object, if someone can ...
1
vote
1answer
147 views

Unity, understading Layout element - Min size and preferible size

I have been some time working with unity, and I am trying to get a better understand of the UI system. I am a mobile developer and I am redesigning the UI but I am unable to achieve what I want. My ...
0
votes
0answers
18 views

Understanding particle texture rotation / space

I want to remake a "portal" that I've seen in RE4. It looks like this: I have observed it, and to me, it looks just like a texture rotating on a cylinder. To remake this, I thought that I should use ...
1
vote
0answers
9 views

How does IAP relate to Unity's Package Manager?

In Unity 2018.3, if you open Window > Package Manager, you can choose to install/remove "In App Purchasing". This seems to be completely separate from the IAP version installed from the Services tab. ...
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 ...
2
votes
2answers
777 views

How do I successfully implement Google Mobile Ads and Google Play Services into my Unity arcade game?

I have been trying for like a month now to properly implement Google Play Services and Google Mobile Ads into my Unity Android Game. I have had success in getting Google Play Services to work but when ...
0
votes
1answer
39 views

In Cricket games, how is the ball synced with batsman's shot animation? How does the ball hit right at the center of the bat? How does this work?

I've been trying to figure this out for quite some time now. In Cricket games, when the bowler bowls, and batsman takes a shot, how does the ball sync with batsman's shot animation? For example, let'...
0
votes
0answers
11 views

A collider defined as intersection of two colliders

I'm working in unity and I have the following problem : Suppose you have an object that's very similar to say the intersection of say the corner of a cube and a ball, and you want a nice collider for ...
0
votes
0answers
18 views

I want to be able to branch a path based on choice

I'm making a 3D game in Unity in the style of a board game. I'm still very new to C# and this prototype of a game is to let me enter the college I want to go to. The foundation of my code is based on ...
0
votes
1answer
13 views

Rotating objects in an random rotation around center point

I almost have what I'm looking for. Still trying to understand rotation and spawning of objects. I have a ground field with a number of spawn points (and they are placed randomly in a circle). It's ...