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
-1
votes
0answers
11 views

How to call an ontriggerenter2D to another script? [closed]

This is the script I want it to be called (player script) ...
0
votes
0answers
10 views

How to fix "Operation FindFriends (222) not called because client is not connected or not ready yet, client state: PeerCreated." in Photon

So here I am trying to add a Player as a friend to myself. I am following a tutorial for the same So I am using the PlayFab to update the friend List. When the update is successful onFriendListSuccess(...
0
votes
0answers
11 views

How do I integrate Unity and CodeCov?

I'm working on a new project using TDD, and I remember on an old project with a friend I used CodeCov, and loved it. Right now I'm generating coverage reports using Unity's Code Coverage package. I'm ...
0
votes
0answers
12 views

How to implement a friend request system for multiplayer games in Unity

I am trying to convert my single player game into multiplayer game using Unity and Photon+PlayFab. Here is exactly what I need: Player A wants to be friend with Player B. Player A sends a friend ...
0
votes
0answers
16 views

Do not cast shadows when transparent in unity

I am developing a game for WebGL and I have a shader that makes parts of an object in specific ranges of coordinates transparent, like so: This shader makes all parts of an object with an absolute Y-...
1
vote
1answer
15 views

Unity serialization with preprocessors

I am working on a Unity multiplayer game using mirror, and i separated server- and client-only code using partial classes and preprocessor #if statements based on this answer i found: https://gamedev....
0
votes
0answers
30 views

How should I unit test movement in Unity?

I've been banging my head against the wall trying to unity test player movement in Unity. So far, I've been trying by using the Testing framework included with the New Input Action System, so I've got ...
0
votes
0answers
26 views

How pull and push an object in a 2.5D game?

During my journey to try to do this, I tried a couple of 2D and 3D game methods; but both were useless, as in most cases it made the box "fly"; and it's not what I want(to be specific, ...
0
votes
1answer
33 views

How to make a code-generated mesh interact with a rigidbody?

I'm using a sphere and an empty game object that generates a mesh upon playing/starting. On the mesh, I place a Mesh Collider component with ...
1
vote
0answers
18 views

How do I view the test going on in Unity Playmode?

I'm working on a new project using TDD, and I'm doing a good job of checking everything from the ground up including checking physics interactions on instantiated prefab, but I've gotten about to the ...
0
votes
0answers
6 views

physics.ignorecollision not working for some children

Using the XR Interaction Toolkit, I have an XR rig with a rigidbody and collider, which has children that have rigidbodies and colliders, and whenever the childrens ...
0
votes
0answers
5 views

How to remove the downloaded learning projects from Unity Hub on macOS (Big Sur)?

I downloaded "LEGO® Microgame" earlier but the project files seem corrupted and I cannot open the project, so I want to download it again. How to do this? The asset files were deep under <...
0
votes
0answers
12 views

2D Animation position offset for certain states

I'm looking for a way to offset the position of an 2D animation for certain states. Storing the offset (x, y) is not a problem, my issue is how to manipulate the Animator to apply those coordinates (...
0
votes
1answer
35 views

Is `if (gameObject)` the same as `if (gameObject != null)`?

If you have a Game Object, and you want to check if it exists, is if (gameObject) { } the same as if (gameObject != null) { } ...
0
votes
1answer
29 views

How to move a character gradually over a list of waypoints?

I have a list whose elements are Vector2 points in world space: (9, -9) (9, -13) (5, -13) What I want is that my enemy character should first go to (9, -9) ...
-1
votes
0answers
16 views

How to create a multiplayer game chat in Unity

I would like to create a multiplayer chat game where a team should have their own private chat with photon but I am not really sure about how to create it.Any help will be appreciated
0
votes
0answers
11 views

Unity, Universal Rendering Pipeline - Shadows are very pixelated even though shadow resolution is 4096. How to make shadows look better?

I'm using URP and I set shadow resolution to 4096, which is the max: But shadows still look very pixelated: How do I make the shadows look better?
0
votes
0answers
5 views

Package Cache error in Unity rendering cloned project unusable

I recently cloned a repository from GitHub, the project is fully functional and up to date on my friend's system, but when I clone the repository I get these compiler errors which need to be resolved, ...
0
votes
1answer
34 views

How do you make Cube not instantly rotate upon Keypress in opposite direction?

I have this movement script on a Rigidbody cube with X,Y,Z Rotation Constraints. It is working well to move and to rotate in the direction of the movement. However, ...
0
votes
0answers
13 views

Shirt in front of body: Render a gameobject always in front of another despite position, keep lighting [duplicate]

How do you "hide" the body behind a shirt, or render the shirt as always in front of the body - without losing the lighting?
0
votes
0answers
28 views

GameObject.Instantiate isn't applying rotation

My scene has a GameObject positioned out of camera view. Let's call it 'Cat' Cat's transform.rotation is (0,90,0) I have a script bound to an otherwise-empty GameObject. Let's call it "...
0
votes
1answer
8 views

Dragging GameObjects out of UI

I want to drag a game object out of a UI. Currently, I am instantiating a game object on top of the UI(on an upper sorting layer), and adding code to make it able to drag the object. However, Unity ...
0
votes
0answers
30 views

how to find out Linux or Windows is better for Unity Server [closed]

I'm working on an online multiplayer game with Unity's UNET system. I test my game between some players and I used the windows platform for my servers. But I want to know if I choose Linux instead of ...
0
votes
0answers
15 views

transform.localPosition does not wok in Unity

When im breaking fence GameObject there should pop up scores, so it works fine. But position of pop up scores is too low, im trying to raise it by ...
0
votes
0answers
28 views

Unity sprite takes 5 times more memory in profiler

So as stated I have a sprite that when compressed takes 2 MB. But when I look into the memory in the profiler, it says that the sprite uses 10 MB! This happens both when I profile in the unity editor ...
1
vote
1answer
19 views

Unity3D InputSystem works in editor but not in Build

I am trying to move a camera around with controller input using the new Unity Input System package (Ver. 1.2.0) and everything is working great in the editor. However, as soon as I build the project ...
1
vote
1answer
14 views

How to Correctly Declare Unity's New System Input as an Assembly Definition Reference

I have 3 main assemblies, Core, Character, and Interactable. Interactable and Character both depend on Core. I got an error saying I needed to add TMPro as a dependency for Core, so I did that, and ...
0
votes
0answers
12 views

Disable UI button does not work when calling function directly, does when calling intermediate function that Invokes disable with a delay of 0

Trying to understand the Unity UI system. I have a panel that contains a button that should hide the panel. When I wire the button up to the method that hides the panel, I can see in the console that ...
0
votes
1answer
28 views

How to modify the z depth value inside the vertex function of a surface shader?

I wrote the following surface shader. The idea is to increase the Z depth value of vertices, after projection. ...
0
votes
0answers
13 views

How to make golf putter rotate to ground normal's and still rotate with the handle

I am making a vr golf game and I am trying to get the putter to be level with the ground and still rotate with the putter handle. The two pictures below will demonstrate the problem. Then after I ...
0
votes
2answers
51 views

Why is my player ball's movement bouncy and bumpy?

I've come across an odd effect in Unity and would like to understand why it's happening. Using some simple code I've achieved a horizontal movement effect, of a ball across a flat square surface, yet ...
0
votes
0answers
29 views

What causes Rigidbody character to suddenly move at fast speeds?

I'm trying to make a Rigidbody-based movement script for a character. It behaves pretty much as expected, but every once in a while the character will suddenly run at a massive speed. I can't find a ...
0
votes
0answers
18 views

How to properly use texture atlas for 3d objects in unity?

I have a texture atlas that contains 7 images. They are arranged in 2 rows and 4 columns so x=4 y = 2. I know I can change tiling and offset of a material so I can create 7 materials and set offset to ...
0
votes
1answer
21 views

How to make trigger function respond to certain collider pairs and not others?

I assigned two colliders to one GameObject. Both are different sizes. I am doing operations with Trigger messages. I want this Trigger function to work for only colliders 1 and 3, but not collider 2.
0
votes
1answer
46 views

Level Creation - How to achieve seamless race tracks?

I'm aiming to make a racing game in Unity. Please take a look at the image provided below, and suggest me the best technique to achieve something like it. (Keeping the performance as optimized as ...
0
votes
1answer
54 views

Unity does not kill everything on application quit

I'm finding out that unity does not fully destroy all game objects on application quit. The result is that I have a number of async/await functionality that eventually runs and I can see output stream ...
-1
votes
1answer
30 views

Why does my model disappear as I get closer?

As I get closer, the model I made disappears. how can i fix this situation?
0
votes
0answers
50 views

Unity - Billiard balls unrealistic movement

So, I have this problem, even when I apply a small amount of force, the balls seem to get pushed away easily. Here's how they should behave (GIF from 8 ball pool game): And here's how I have it : ...
0
votes
1answer
22 views

Unity approaches for automatically setting pivots of each sub-gameobject at base center

I'm working with some free models online, which don't seem to have pivots properly set for any of its submodels. Is there a universal pivot fixer or something if not... The center seems correct for ...
1
vote
1answer
386 views

If I can add a Text above my player/object without a canvas then what do I need the canvas for?

In all tutorials they are using canvas for the text to put the text above the player/object. Why not just make empty GameObject as child of the object you want to add the text above and add to the ...
0
votes
2answers
30 views

Why am I getting Null Reference Exception inspite of checking if the Object is not null to execute something

Hi I am just trying to convert a simple flappy bird game into multiplayer game. So In the multiplayer game using Photon , I want the bird to collide with the ground or pipe but not with the enemy bird ...
1
vote
1answer
26 views

Creating a room with custom options that persist to other players

I am using Photon for networking in my project. I am creating a room with PhotonNetwork.CreateRoom(). I pass in the room name as well as a set of room options where the room options just specify the ...
0
votes
0answers
20 views

How to change ui text position?

I have this script attached to a cube : I want to be able to change the ui text textName position. The problem is in the Update I'm setting the textName position because I want the text to be above ...
1
vote
1answer
28 views

How to get/edit the script of the built-in "Character Controller" component?

I was using Unity's Character Controller component, but I found it very limited and wanted to tweak some things. I thought about creating my own character controller from scratch, but it would be much ...
1
vote
0answers
30 views

Unity Input System - The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine'

I've just installed the Input System Package in Unity. Visual Studio Code is not recognizing the InputSystem namespace on the line using UnityEngine.InputSystem;, ...
0
votes
0answers
14 views

How do I distinguish a network of triangles connected by only 1 vertex as separate meshes?

I'm having trouble figuring out an algorithm to do this. It also seems to be very performance heavy potentially. I'm currently using Unity's Mesh component for this. In this example, I want triangles ...

1
2 3 4 5
297