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
0answers
14 views

Unity: How to receive input events on a RectTransform that does not contain any image/text/…?

In Unity 2018.3: Imagine a GameObject with only a RectTransform component and a custom script attached to it - otherwise ...
1
vote
0answers
37 views

Preventing Unity from writing to the registry?

I see that Unity automatically writes some info to registry when it launches the game. Several people have this problem too: Preventing Unity from writing to the registry. How to disable writing to ...
1
vote
1answer
34 views

issues about combo attack system animation

i have some issues about my attack animations right now, i'm doing my light attack which has 3 separate attacks and animations. the scripting and trigger works(without animation), but my animation ...
0
votes
0answers
43 views

i am working with json and fetch the images from the server but images not load faster? [closed]

fetch the image json server and initiate my gameobjects and convert(sprite.create) and then store instantiate my gameobjects ...
0
votes
1answer
17 views

Raycasting from an object to the center of the screen (crosshair) without clipping through objects

Am trying to learn about Raycasting, and I thought I would start with something simple, and that was a laser that would come out of an object (think laser pointer in your hand) and always go to the ...
1
vote
2answers
23 views

Unity 2D rigging parts order

Hello I have some 2d character in sprite I've rigged to use in Unity 2D.Something like this, with separate body parts. Although I've used weights and geometry, these body parts are supposed to move ...
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 ...
1
vote
2answers
85 views

How can I sync billiard balls in network?

I'm developing a billiard game my problem is I don't know how can I sync balls in network I use forge for networking but feel free to answer photon or unet because I know them. What I tried 1....
0
votes
0answers
18 views

“Namespace cannot directly contain members” error

Here is my code that could not be compiled because of this: in the first line of this code is indicated: a namespace can not directly contain members such as fields or methods ...
0
votes
1answer
22 views

Unity point light baking into lightmap

I'm developing a puzzle with a ball with cracks on it. Inside the ball there's a point light. Its light rays come out of the cracks and hit some platforms (walls/ceiling/floor). To solve the puzzle ...
0
votes
2answers
30 views

WaitForSeconds error

I'm new to c# and coding, sorry if I sound like a noob... I don't know how to fix the waitforseconds error, and I don't know what's wrong. ...
0
votes
1answer
35 views

My Unity project does communicate with MongoDB on the Editor but not on compiled build

I was trying to implement MongoDB with my Unity WebGL and everything is working fine so that I managed to insert and retrieve documents from my mongo database with no issues, so everything was perfect ...
1
vote
1answer
555 views

How do I implement bullet spread in three-dimensional space?

How can I shoot a bullet in three-dimensional space in such a way that its path diverges a bit, randomly, from the direction in which the gun is pointed? I know I have to use the Quaternions, but I ...
0
votes
0answers
8 views

Using Unity Editor via RDP : First-person-controller not work. Is there any workaround?

Good day. I'm trying to use Unity Editor on a remote server using RDP. All works well except the First Person Controller: there's no way to move player view using mouse (instead, keyboard commands ...
0
votes
0answers
15 views

I Can't spawn buttons in my Grid. why?

Today i was following a tutorial about making a shop, but i got a problem. and i've followed the scripting tutorial, but it seems i can't spawn a button inside the grid when i pressed GetItemButton. ...
-1
votes
0answers
12 views

Can anyone solve this error- (gamename) has unfortunately stopped. I have the logcats [closed]

My game worked totally fine for several times until once when i exported it to my android device, it Threw the Unfortunately game has stopped error. The name of my game is Birdy. As this is my first ...
0
votes
0answers
18 views

How to get gravity to change with mobile tilt in Unity

Let's say I was making a mobile unity game and I retrieved the tilt variable and put it into a vector3 to apply forces to a cube, this works for one cube but not for every game object. I want the ...
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
30 views

Public variable changed in script isn't stored in playmode

I have a public variable float x in script Foo.cs. I have a Bar.cs script with a function ...
0
votes
0answers
14 views

Unity 3d (gamename) has stopped- logcat included

I have created a game and ran it successfully on my phone multiple times. But once, when i tried to run the app after exporting it, it threw this error. Unfortunately, Birdy has stopped. The name of ...
0
votes
1answer
16 views

Unity: how to hide touch-screen joysticks in the main menu?

I am a Unity beginner trying to make an app/game. How do I hide the touch-screen joysticks from showing on-screen in the main menu before the game/app actually starts?
3
votes
1answer
37 views

How to invert a Tilemap's coordinate system?

The Tilemap object in Unity uses a coordinate system that grows up-right from (0,0). (ie. with the Origin at the bottom-left of the screen.) I'm trying to represent a mapping system that has the ...
0
votes
1answer
21 views

Destroying copy of DontDestroyOnLoad GameObject?

I have a Main Menu with level selecter up to 5 different scenes on one Map. I also have a MenuManager which doesn't get destroyed between the scenes to gather the bool information of level finished or ...
0
votes
0answers
17 views

Unity WebGL: how to copy to clipboard text from an inputField?

I would like to know if is it possible to copy a text from an InputField using c# script. Thanks
0
votes
1answer
27 views

How can I add different colliders to each body part of a character in Unity?

I have been using unity game engine for about two weeks now. And I'm very interested in 3D game development. I have been learning basics of Unity and third person games. I saw many tutorials about ...
7
votes
3answers
3k views

How to move the player while also allowing forces to affect it

For now, that's how I move the player: rb.velocity = Vector2.right * input.x; And I affect him a force while he is damaged by an entity: ...
0
votes
0answers
13 views

Use references to UIManager script or direct for children OBJs

So I've got a canvas with UIManager script attached to it, the canvas has a lot of buttons and texts as children OBJs and they somehow need to communicate to each other. Should this be done through ...
0
votes
0answers
40 views

Is Google Play Games Services Multiplayer (Turn based) free? Is there any limitation on number of users?

I was just visiting Google Play Games Services guide for signing In in Unity. I just came to know there that Google Play Games also provide services for Multiplayer. I'm currently working on my Indie ...
0
votes
0answers
14 views

How to load an AudioClip at runtime without the WWW class?

I am currently pulling a .wav file from an API. I would like to play it at run-time. Currently I need to save the .wav file to ...
0
votes
1answer
25 views

pass by reference a transformation

I create a C # script in which I declare a transformation: public Transform Origin; When I put this script on an object of the hierarchy, in the Inspector a field Origin appears at the level of the ...
0
votes
0answers
80 views
+50

How do I keep a rigidbody from making unnecessary collisions on smooth surfaces in Unity3d?

I have been having trouble with a custom character controller I am making. The root of the problem lies with collisions. I am trying to make movement code, but I have a problem with ground movement. ...
0
votes
0answers
35 views

Help to Code Bowling Like Feature in Unity for Mobile

I need Code or Guidelines for Touch Feature. When We Drag ball back and Send it Forward. I am Making feature like bowling, and I need Player to add force while dragging back and also curve the path of ...
1
vote
1answer
68 views

Best C# technique to pass variable from Instantiated object to GameObject

There are lots of instantiated prefabs. Info from it is transmitted while it crosses a trigger zone. Some of these are calculated custom variables. I can print the custom variables from the ...
0
votes
0answers
17 views

How do I determine the distance between two points in tilemaps in unity?

If I have a tilemap with multiple layers, is there any way that Unity offers to help me infer the distance between the two points? Also, as a related question: Are there any libraries written in C# ...
0
votes
1answer
11 views

What is causing my 3rd person camera to lose rotation on the z axis?

I've been working on a 3rd person camera on unity for a couple weeks, but I've pretty much hit a wall, specifically to do with my camera's rotation. When I rotate it on its x and y axis it won't have ...
1
vote
1answer
26 views

Camera that pivots in the direction that the player is moving

I'm trying to recreate Rocket League's freeform (non ball-locked) camera, which basically is a camera that follows the player but pivots to allows face the direction the player is moving in (not ...
1
vote
1answer
17 views

jumping and movement with rigidbody2d.velocity, gravity problem

i'm making a 2d platformer and i move my character with rigidbody2d.velocity swiping up to jump and moving while holding the left or right side of the screen. the problem is that when i jump and i ...
0
votes
1answer
17 views

How can I get sensor data on iPhone onto a Windows PC? For use as a steering wheel

I am making a Unity game. I want to be able to allow the phone to be used as a steering wheel, as input into the PC game. Technically, How can I achieve this? Can this be done through bluetooth? ...
0
votes
1answer
29 views

For creating a distant moon in a 3D game, is it better to use a model or texture?

I'm working on my indie game and I want to create a moon (it's a 3D game) however I am unsure if I should create a model and put it far away, or if I should use a texture on a plane and have it ...
0
votes
0answers
9 views

Unity, getting a null reference after baking in occlusion

I have imported models from blender into Unity, also checked generate lightmap UV's in the import settings. Then I set the model as static and baked the scene. After that when the object is ...
0
votes
0answers
17 views

On Unity how do I play an animation on drag direction?

I am trying to make an animation start when I Drag the mouse inside a picture and move it it left and down. while dragging the mouse pulling the nose down and left. I am not sure how to go about this ...
0
votes
0answers
32 views

Do I need a server if I only want to upload data to a DB?

I'm currently creating a game where people get some kind of reports for their game performance on a website. Let's say, you log-in, play the game, the system gathers your performance data and this is ...
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 ...
-1
votes
0answers
17 views

How can I make my car speed gradually increase overtime?

I am making a drag racing game and I want my car to accelerate until it have reached its set top speed. I am kinda new to game development so I don't much, so please help me. If I could also get a ...
1
vote
0answers
17 views

Circle ceases to be a circle when radius is below a certain value

I'm using the LineRenderer component to draw a circle. It renders fine, but it's a little too large. The smallest I can set the radius is .06f. If I try to set the radius to anything less than that, ...
0
votes
1answer
13 views

Unity: Change the type of a Texture2D to “Normal map” through script

I am making procedural terrains through c# script, and while I achieve to produce a texture, a heightmap and a normalmap to Texture2D, it seems they are not being ...
0
votes
0answers
11 views

Generating Mesh using Compute Shaders

I am working on a game project in unity which has a procedurally generated terrain made up of 16*128*16 chunks of blocks. The map size is going to be finite (Possibly up to ~100*100 chunks). Currently ...