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.

Filter by
Sorted by
Tagged with
0
votes
2answers
84 views

How to move Character according to Camera's look direction?

...
0
votes
0answers
285 views

Unity Soft Shadows

I'm building a puzzle level in Unity. I have a ball with cracks on it and a point light inside it. The goal is to project the light coming through the cracks into the walls. I've managed to do that ...
0
votes
1answer
89 views

How to scale a sprite on x axis to touch the point without changing pivot?

I have a sprite. The pivot is at random point. I want to increase the sprite's scale on the x axis, without moving the pivot, until its edge touches a point at right. I have a method to set/add size....
0
votes
1answer
108 views

how to duplicate a button via script?

I have the following code: ...
0
votes
0answers
35 views

How can I load back from a text file the values to the variables?

I'm using a simple text file to write to using StreamWriter but maybe it's better to use a json. For example how I used the json before: ...
0
votes
1answer
38 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 ...
0
votes
0answers
20 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. ...
0
votes
0answers
30 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
1answer
153 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
254 views

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
67 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 ...
0
votes
0answers
235 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
44 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 ...
0
votes
0answers
52 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
38 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
159 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
2answers
62 views

How to change 100 GameObjects' color without pushing RAM to hard?

I'm developing a mobile game and one of the gamemodes has 100 gameobjects(basic cubes). And they all have same material. I need to know how to change their color one by one with script. I'm not very ...
0
votes
0answers
215 views

Unity: how to position items into a Scroll View?

I'm trying to add items (prefab) into a Scroll View but either if I simply add items without set positions and trying to setting position it not work. Case 1: without setting position Result: All ...
0
votes
1answer
116 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
0answers
99 views

No Support for UnityScript (JavaScript) on 2018.3

Hey I’ve been working on a project for over 3 years and yesterday I have updated the unity from 2018 to 2018.3 and lost support for JavaScript. All of my scripts attached to gameobjects are there but ...
0
votes
0answers
21 views

Increase sound tempo in Unity when new player joins in Kinect game

I'm using Unity to create a Windows-build game with Kinect. I have some drum beats, which can either be used as single sound effect or be edited to be a piece of continuous music. I want these drum ...
0
votes
1answer
25 views

How to add state to the custom inspector in Unity

I'm writing a custom inspector for my asset (by deriving from Editor), and I have a few variables controlling the state of the inspector (like whether a foldout is ...
0
votes
0answers
30 views

Spin camera around origin/focus in Unity editor

I have used Blender a bit, and like the way the camera in the editor orbits around the focus/origin when dragging with middle click. I've recently been using Unity a little and despise the camera ...
0
votes
0answers
89 views

Why do I get a “Value Cannot be Null” error on material.SetTexture?

Probably a really noob question, but: I'm following this tutorial here and, using the code in the tutorial, I'm getting an annoying error: Here's the code in question, the error is referring to line ...
0
votes
0answers
160 views

Textures go black when changing Quality Settings at runtime

Whenever I change my Quality Settings at runtime in editor mode or in build, all of my textures turn black. I use the following line to change the quality settings : ...
0
votes
1answer
62 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 ...
0
votes
2answers
270 views

Pixel Perfect 2D tiles

I'm trying to make an 64x64 tilemap using Super Tilemap Editor & Unity but my tiles looks terrible. I did my research about pixel perfect 2D and all of the solutions were for pixel art, they didn'...
0
votes
0answers
435 views

Unity sprite rig affecting performance

I created a simple sprite rig using the skinning editor provided by the new 2D Animation V2 package. But it causes a huge FPS drop when added to the scene. Methods such as SpriteSkin.LateUpdate ...
0
votes
1answer
298 views

Raycasting center of camera is not working: why?

In my game i'm using Unity First Person controller. I check every second what I am looking with the following code: ...
0
votes
0answers
20 views

writing problems with MonoDevelop of Unity 3D

MonoDevelop was automatically installed by UnityHub. The text editor poses a lot of problems because you can not insert a specific character (I position myself, the positioning is not famous and when ...
0
votes
0answers
16 views

How to retrieve the coordinates of an animated object?

On Unity, I created a script in C # to animate a cube. I am trying to create a script in C # which, once the animated object and in support of a key of the keyboard (for example F) returns to me the ...
0
votes
0answers
226 views

Why is Unity MouseLook very shaky and jittery?

I'm working on a first person shooter game. My problem is that my Mouselook script is shaky and jittery when I looking around. Here is my code: ...
0
votes
0answers
30 views

Real Time Physics Based Mesh Deformation [duplicate]

I'm working on a game through unity that draws one of is essential elements from traditional tool forging techniques for building tools and such. I want the feel of the game to be able to create a ...
0
votes
1answer
37 views

Photon2 Unity2D How to send float with RPC

I have big problem in my code .. I want to spawn obstacle exactly on the same position as on the server is spawned so I made rpc Method and tried to pass random variable of float , but when i run the ...
0
votes
0answers
194 views

Simulate piston for forklift using PhysX 3.4 ( Unity 2018.3 )

I need to simulate a piston for a forklift, but I don't really know how to create an accurate physics model. The forklift ( a car with some wheel colliders ) should react to the force applied by ...
0
votes
0answers
14 views

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

Hi so im displaying food, health an water on the screen in a text box by using UnityEngine.UI and making text variables. They are all defined in the update function so they will keep changing and are ...
0
votes
1answer
120 views

Play games services leaderboard does not work all the time

I am trying to login into play services. I got it working. But there were duplicate game objects created. So I added do not destroy on load and now the play services work the first time I access it. ...
0
votes
0answers
135 views

Is it more efficient detect when audio clip ends with AudioSource.isPlaying or with AudioClip.length?

In Unity, I want to trigger an event when an audio clip finishes playing. Would it be more CPU efficient to keep checking if the audio clip is playing with ...
0
votes
2answers
1k views

Unity WebGL player just shows black screen

I built my Unity project with WebGL. After load the resources, I can hear the music and player sounds(movements etc), but it just display black screen only. I found some similar situation in google, ...
0
votes
1answer
234 views

Quaternion.LookRotation with Joystick

I am having an issue i cannot seem to figure out within my code. What this code does at the moment is that it rotates the 3D Model around the z axis but i need it to rotate around the y axis. Any help ...
0
votes
0answers
65 views

Can't refer mesh size after using .BakeMesh() in Unity

I can't figure out how to refer to the size of a particular mesh. The mesh is created through .BakeMesh(), then a box collider is added. Unfortunately the box ...
0
votes
0answers
312 views

Simple shader that scales UI image from the center

I'm having trouble making a (vertex) shader that scales UI images from the center. I can scale the image, but the image doesn't stay centered. Here is a project showing the problem Here is a ...
0
votes
0answers
55 views

Resolving this kind of situation in my platformer (movement on slope with roof)

I'm building a simple 2D character controller based on raycasts. At this moment I'm trying to finish the player-ground interaction. For the ground I will be using edge colliders and no tiling ...
0
votes
0answers
157 views

Unity3D mobile 4G internet web request is very slow

I have a windows VPS server and i have installed an Apache server on it. in my server I only have a simple text file that contains some few words. My problem is that when I'm trying to sending a web ...
0
votes
1answer
209 views

Smoothen line on linerender

I've created a square using linerenderer but my problem now is that the line is not smooth. see below picture. I've tried enabling anti-aliasing and setting lr.numCapVertices to no avail. ...
0
votes
0answers
53 views

How can I change the parameters of the random events for each game entity?

I'm trying to write an easy-to-use random event system that has certain conditions and effects in Unity. It's a simulation game that contains multiple Person, City, Country, Faction elements. I have ...
0
votes
1answer
129 views

Make half of the sprite transparent

Guys if I have two sprites placed on the same spot. How can I show the half of each Sprite instead of the one on top? The sprites are basic circles All sprites have basic colors, no textures.
0
votes
0answers
200 views

How does Unity store references to GameObjects in a scene

A Monobehaviour can have references to GameObjects in the same scene, but Prefabs, ScriptableObjects can't reference GameObjects in a scene. While Assets, Objects and serialization covers references ...
0
votes
0answers
114 views

Why is the play button not working on the title screen of my game?

I'm trying to open up a game demo from my class to see what it looks like, but after opening up the project in Unity, the title screen doesn't work correctly. When I try to click the "Play" button, ...
0
votes
1answer
202 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 ...

1
206 207
208
209 210
246