Skip to main content

All Questions

Tagged with
0 votes
1 answer
13 views

Working on a 3D audio visualizer project (Unity) and I can't convert Vec3 to Float, what am I doing wrong?

Noob here... I am working with a c# script in Unity which was originally written to scale an object on 2 separate axes (X/Z) using 2 separate variables (based on audio input). The change I am trying ...
Jeremy Romanowski's user avatar
0 votes
0 answers
25 views

Multiplayer game in Unity riddled with seemingly unsolvable errors: type or namespace Unity Transport not found, and scripts not attachable to gameobj

I'm making a multiplayer game in Unity, and I've started by implementing the multiplayer feature itself. After making good progress, I get an error telling me that type or namespace UnityTransport can'...
Bobcat's user avatar
  • 1
0 votes
0 answers
13 views

Unity Application crashing on Android?

I've been working on an application in Unity. It works perfectly fine for iOS devices but once a build has been put onto an Android device it begins crashing after about a day of being on that device. ...
Jackson Laumann's user avatar
0 votes
1 answer
29 views

Calculating angles and comparing them to apply logic

I'm trying to make a grappling hook style game in Unity. When the rope collides with an object, I move the anchor point to that position and save a List<Vector2> of positions. I'm at the point ...
Cjmarkham's user avatar
  • 9,611
1 vote
1 answer
28 views

Float values get rounded creating a Hex Grid in Unity

My code generates a grid with a specified width and height and Instantiates a "hexTilePrefab" at the calculated floating point positions. The prefab has a class "HexTile" attached ...
SoggyEyeball's user avatar
0 votes
1 answer
28 views

Area of damage, where an explosion happens and deals damage to all enemies exactly once with Physics2d.OverlapCircleAll(...), but doesnt work

As in the title, I am trying to use overlapcircleall to deal damage to all enemies exactly once, but sometimes works correctly, but sometimes the damage is applied multiple times to the same enemy, ...
Eduardo Marinho's user avatar
0 votes
1 answer
40 views

OOP usage in Unity Game Engine

i've started to learn Unity and we were always using MonoBehaviour Parent and Child Classes. After that i realized that we need to use OOP with our projects. I know how can i create classes and ...
Melih Altuğ Çelik's user avatar
1 vote
0 answers
18 views

SignalR Client implementation in unity works in editor but not in Android

I am using signalR client in unity for a real-time Android game. So, when i run game in Unity editor, everything is fine, But when i built it for android, i realize that it didn't connect to Hub ...
mohammadreza khorasani's user avatar
1 vote
0 answers
27 views

How can I align my player to a ledge (Unity 3D)?

I am working on a game with a grapple system similar to the Batman Arkham games. Right now, you can target a point on a ledge and teleport to it (Teleporting is just for testing) and then hang on it. ...
Cormac Franz's user avatar
0 votes
1 answer
29 views

Uploading a video(file) through file explorer in Unity WebGl

I'm developing a game on Unity WebGl. I have a part that user has to upload a video through file explorer, then I have to send it to server. I don't have to play it in unity. I just need to get the ...
Fatemeh Zare's user avatar
0 votes
1 answer
41 views

Unity 3D: Instantiating an object after setting it into a list isn't consistent

I am making a game where people walk around catching cats then releasing them into a safe spot. Here's all the relevant code: using System.Collections.Generic; using Unity.VisualScripting; using ...
Geeky15's user avatar
0 votes
0 answers
21 views

Unity Cloud Save blocks game

Hey I am trying to use Unity Cloud Save feature. I've added SDK for Cloud Save and Authentication and Linked Unity Project. I am also using Firebase so there is also configuration for it. All fun ...
sennin's user avatar
  • 8,822
0 votes
0 answers
19 views

How to detect the proper World space UI element's position using GraphicRayCaster?

Good afternoon. I am trying to interact with UI elements within a worldspace canvas due to Unity 2022 LTS not supporting interaction via the New Input System when using a locked cursor. The issue I am ...
user171859's user avatar
1 vote
0 answers
28 views

Generating a different zipcode after each spawn in unity

Sorry for terrible grammar but I've been working on a Conveyor Belt project for the past month and been having problems with the parcels(Boxes) not having specific zip code after each spawn. I'm still ...
Itha's user avatar
  • 11
1 vote
1 answer
37 views

Having trouble centering a Gizmo in Unity's editor with an Isometric Grid where Z axis serves as Y axis

I'm trying to make the boxes in OnDrawGizmos() center isometrically within each tile. As you can see, I want to know the coordinates of each tile and always have them displayed in the editor. As you ...
Sergio García Vico's user avatar
0 votes
1 answer
31 views

Read json dictionary with multiple sub keys into unity c# script

I am trying to get my data from a json file into unity with a c# script. The goal is to move all players at the same time based on positional data, which i already have. I need to group the ...
Vintertid's user avatar
3 votes
0 answers
26 views

Make a Texture3D writeable on the GPU in Unity

I have a Texture3D that I've defined: tex = new Texture3D(8, 8, 8, TextureFormat.RFloat, false); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { for (int z = 0; z < 8;...
Jimmy Diddler's user avatar
0 votes
1 answer
27 views

Player is jittering when colliding with a wall

When I move against the wall, the player starts jittering. using UnityEngine; public class Movement2 : MonoBehaviour { [Header("Movement")] public float Speed = 4f; public float ...
Mighty's user avatar
  • 3
0 votes
2 answers
40 views

Unity: Script won't delete 1 of the objects if 2 are colliding

I have this C# segment of code to make auto generated rooms, does anyone know why my code won't delete the clones of the object? I've tried a lot of methods, but I can't for the life of me get it to ...
Gleep Glorp's user avatar
0 votes
1 answer
23 views

Unity State Machine suddenly refuses to react to player input

I have been attempting to create a souls-like character controller in Unity, using this tutorial with the use a Finite State Machine using the following tutorial. So far, everything has been working ...
bunbunbea's user avatar
0 votes
1 answer
27 views

The car does not turn when using the Wheel Collider

I'm trying to make a car controller using Wheel Collider. I have 4 wheels. And the parent object with rigidbody and box collider. Inside the parent object, I have four objects with Wheel Collider, as ...
kR0Un's user avatar
  • 3
0 votes
0 answers
19 views

What's going on with the lighting?

With the lighting on my HDRP stage, something is wrong with the lighting in some corners on the floor and on the walls. I don't understand what this could be related to. I also tried to place Light-...
SOOBATON's user avatar
0 votes
0 answers
57 views

When I edit UnityPackage and Export & Import, I get "The type or namespace name 'xxxxx' could not be found"

I'm a beginner with Unity. I imported a UnityPackage distributed on GitHub into my scene. There were no errors when I imported the UnityPackage distributed on GitHub. After making a small edit to the ...
taichi's user avatar
  • 661
0 votes
1 answer
47 views

How can I make my enemy target a player who enters the scene?

So to explain a little further, I want an enemy from scene 2 to target a player that starts in scene 1. I already have a script for the damage and a AI script for the enemy, to chase the player, but I ...
Adeline Haun's user avatar
0 votes
2 answers
35 views

How to create a list that spawns enemies that are placed into the list via the unity inspector

I am trying to create a list of enemies that can be spawned via trigger in unity. However I am running into an issue where my public GameObject enemy seen in the enemiesToSpawn class is called on ...
Thomas Wilson's user avatar
1 vote
0 answers
29 views

Weird movement using Mathf.LerpAngle Unity

I was making half 2d ,half 3d game. I wanted the up/down movement to be accompanied by a slight rotation in the direction the player is moving, for that I decided to use Mathf.LerpAngle method , ...
meow's user avatar
  • 11
0 votes
0 answers
27 views

Unity Input System does not work with Steam opened

I'm making a multiplayer game in Unity and I'm using facepunch.Steamworks for the multiplayer. I made a quick virtual cursor to use in my lobby, so that I can move my cursor with controller. Problem ...
leonardo moreo's user avatar
0 votes
0 answers
16 views

Why textMeshPro makes gc when called SetCharArray?

I am new about Unity. Consider the following function: public void SetCharArray(char[] sourceText, int start, int length) { PopulateTextBackingArray(sourceText, start, length); ...
user25957020's user avatar
1 vote
0 answers
21 views

Unity Editor never releasing memory

I've been working on my unity project, and this happened: So, my project has some Recursive functions, since it is about making a chess engine(rule-based AI). And when I test it out, I find my memory ...
E_ple's user avatar
  • 35
0 votes
2 answers
65 views

Why is this problem of Unity collision count happening?

I'm counting down the collisionCount to get button out if I crash three times. However, the collisionCount is not counted properly, so it continues to be counted as 1. I'm asking questions because I ...
jin ichi's user avatar
1 vote
1 answer
21 views

I am having a hard time getting an object to rotate and move in the object's new forward direction

Why is my player still moving forward(north) in world coordinates? I want the player to face and move in a new direction. Please explain in simple terms. void PlayerMover() { _step = _speed * ...
eyetengu's user avatar
1 vote
0 answers
16 views

Mouse controls inverted when player is upside down (Unity)

I am creating a space game in which the player can be fully rotated, axis independent. No up or down. However, whenever the player is upside down, the mouse controls are inverted. Here is the current ...
TheBreadPerson's user avatar
1 vote
1 answer
20 views

NNModel (ONNX) Assertion Error in Barracuda

I am trying to use a ONNX model for inference in Unity using Barracuda, following this repo. When I try to call model inference, I get the following assertion error. AssertionException: Assertion ...
Tammy Zeng's user avatar
0 votes
0 answers
14 views

How to Save and Load 3D Object Transformations Using QR Code like markers in Magic Leap 2?

I am developing an app for construction professionals using Magic Leap 2. I am trying to save the transformations of a 3D object set at a specific location on a QR code-like marker. The goal is that ...
shubh's user avatar
  • 3
0 votes
1 answer
24 views

When moving a sprite in unity2d how to avoid from the sprite rotating like losing control by the rigidbody but to be able to rotate at turns?

I want to keep using the Rigidbody 2d on the player but when i move the player while he is moving, he also make rotations like losing control. in the Rigidbody of the transform i set the Gravity Scale ...
Daniel Lip's user avatar
  • 11.2k
0 votes
1 answer
52 views

"Decorate" return type in C# child classes

Objective: Serialize data from a class, with the base class taking care of its properties and child classes taking care only of the "new" properties added. Disclaimer: I come from TypeScript ...
danikaze's user avatar
  • 1,614
0 votes
0 answers
22 views

How to replay game dynamically and in slow motion?

I have a problem in ultimate replay package script, I have this code: using UnityEngine; using UltimateReplay; namespace ultimateReplay { public class ReplayManagerScript : MonoBehaviour {...
Piyon Raj's user avatar
0 votes
1 answer
26 views

Problem creating seamless chunk generation

I am working on creating infinite chunks of terrain, with variation in the height using perlin noise in unity, and am encountering problems getting the seams to align to create a tileable environment ...
camden carr's user avatar
0 votes
1 answer
39 views

Why does the player sprite look under the yellow point sprite even if both at the same Z height of 0?

I went in the editor to the menu in the editor: Edit > Project settings... > Tags and Layers and then added the Player and the YellowPoints in the Sorting Layers and then in the player object ...
Daniel Lip's user avatar
  • 11.2k
-7 votes
0 answers
52 views

How To Access An Item In A Struct Which Is In An Array [closed]

I am making a tower defense game and used structs in an array and want to access an item in the structs. I don't want to use a 2d array as that can't show up in a unity editor. I tried tutorials and ...
Simon Y's user avatar
0 votes
1 answer
26 views

SetActive only working for one object when I am calling it from another script

I am trying to have three separate buttons activate at the same time when call from another script but only the first button is activating despite all buttons using the same script. the script inside ...
SomeStupidSheep GD's user avatar
0 votes
1 answer
22 views

How do I call a a method of a script on a condition which isn't attached to a gameobject without calling it from another script

This script's purpose is to increase the amount of enemies that are spawned after all of them are killed, my question is if there is anyway to call this script (like calling it via [...
luigi65536's user avatar
0 votes
2 answers
49 views

Why doesn't LogEvent FireBase work in Unity 2022.3.14f1?

I've been trying to add analytics to my game for 2 days now, on the second day I was finally able to build the project, but another problem arose, my events are not displayed in the FireBase RealTime ...
Max_B's user avatar
  • 13
-1 votes
0 answers
17 views

VR application issue

ia am working on a VR application in Unity where you need to rotate clock parts around a central mechanism in a circular path, maintaining a 3-meter distance.i need for help using c#language using ...
Nagendran Kumar's user avatar
0 votes
1 answer
26 views

How do I make a different interval for the appearance of balls?

using System.Collections; using System.Collections.Generic; using UnityEngine; public class SpawnManagerX : MonoBehaviour { public GameObject[] ballPrefabs; private float spawnLimitXLeft = -...
Юлиан's user avatar
1 vote
1 answer
41 views

Why do my terrains sampled from heightmap image files look "blocky"?

I generate terrains from heightmaps but results look "blocky". It works if I sample the PerlinNoise method for the grayscale value but not when I read it from a texture. Debugging shows a ...
akaBase's user avatar
  • 2,252
1 vote
0 answers
37 views

How to access the mesh of static variable in unity c#?

I have a problem the problem is this how can I access the mesh of the static variable in unity when the variable is in another script and I want to change the mesh in other script if i do not make it ...
Jano Wazir's user avatar
-1 votes
1 answer
39 views

I need help switching sprites when I press A and D

I am trying to make a script where the sprite changes depending on what button you press, right now I am only doing A and D, left and right. I cant get anything to work, I have tried everything I can, ...
goatgamerten's user avatar
0 votes
1 answer
26 views

Making the player move to the right or to the left when the arrow is clicked in Unity

I was working on a script where, if you click the right arrow, the player moves at a constant speed towards the right side of the screen, then stops after leaving the screen. (Similarly, if you click ...
codebetatester's user avatar
0 votes
0 answers
28 views

Draw renderer-line only on roads

I was wondering if it's possible to make my line renderer to be drawn only on the road asset. The problem I'm having is that I bought this asset and the road is combined with street. Is there any way ...
KIN's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
866