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

Multiserver support in Mirror [Unity]

Is there any mechanism in Mirror networking library to scale the load in case single server gets overloaded? There is possibility to use "lobby" conception, but if you want all players to ...
user avatar
  • 103
0 votes
1 answer
18 views

Any way to copy data into a component in another thread?

Pretty sure the answer to this is a resounding no but just in case... Running an expensive algorithm in a separate thread. However, it returns data that must be copied into the arrays of a Shapes....
user avatar
0 votes
0 answers
14 views

Gaps in shadows even with zero bias set Unity

I have a problem with gaps in shadows in Unity. I know that there are many questions about that, but all of the answers are usually about setting bias property to 0. But this didn't help me. I use ...
user avatar
0 votes
0 answers
24 views

Firebase messed up Google Play Games Service authentication and saved data

Currently, I'm collaborating on advertising my game with Google's official advertising team. Recently, they requested me to link my game with Firebase to track user events and analysis. So I made a ...
user avatar
  • 1,113
0 votes
0 answers
28 views

Motor Bike MSK 2 Kit Turning Radius Problem in unity

I am working on a Chopper Style Motorbike Simulation game and using the Motor Bike Starter Kit (MSK) in Unity. I want to change the turning radius of my bike according to my game requirement. But in ...
user avatar
0 votes
0 answers
23 views

Not able to set custom prefab as a mesh to Particle system

I am extremely new to Unity and trying my hands on the Particle System and facing an unusual problem. I don't know whether it is a bug or a legit logic, but in below picture / scene, I am not able to ...
user avatar
0 votes
0 answers
24 views

Should I use blend or state or layer for jump?

I am very confused on unity animation system. Should I be using a blend or state or layer? I need the following animations walk ( WASD ) run ( shift + WASD ) jump ( space ) push/pull ( p) throw ( t ) ...
user avatar
  • 101
0 votes
0 answers
32 views

How do I clear all gameobjects placed on a tilemap?

If I call the following on a tilemap: myTilemap.ClearAllTiles(); It clears all tiles placed using the tilemaps built in system. But if I've placed any tiles via ...
user avatar
0 votes
1 answer
31 views

How to reference a script that's on just one object in the same scene via code?

private TileMovement tileMovement; As you can see in the code above I am trying to reference a TileMovement script, where I ...
user avatar
  • 3
0 votes
2 answers
45 views

How to move an object when a specific event occurs?

...
user avatar
0 votes
1 answer
51 views

How to use Unity job system to do background work spanning multiple frames?

I have a slow level generation algorithm that freezes the main thread when it runs. I found this post which is exactly the same problem, but predates the Jobs system. All the jobs examples I found are ...
user avatar
0 votes
1 answer
28 views

Send an array of struct to compute shader

I am using Unity to send two types of data to the Compute Shader: A struct: struct Flock { public Vector3 position; public Vector3 velocity; } And an ...
user avatar
  • 13
0 votes
1 answer
33 views

How to build a system for ammunition being fired out of cannons when player characters and crewmates can also be ammunition?

I'm currently working in Unity building a game inspired by the niche DS game, Dragon Quest Rocket Slime. It's a Zelda-like forced-perspective top-down game where the primary combat mode is you ...
user avatar
  • 1
0 votes
0 answers
15 views

supertiled2unity isometric tilemap import looks weird in game view

I am using Tiled to streamline the process of creating maps for my game. I am using SuperTiled2Unity to import the Tiled tilemaps into unity. That worked successfully. But when I added an imported ...
user avatar
0 votes
1 answer
43 views

Transforming world to canvas goes wrong when camera is moving

I am attempting to draw a box around a selected target in my space game. I had this working fine using normal techniques when my canvas was set to Screen Space - Overlay. However my setup is that ship ...
user avatar
0 votes
0 answers
17 views

Scene Turns purple on headset but not in editor

I have a scene that looks fine in the editor and even if I am connected via Oculus link and am running the game the plane interior comes out fine. However when I push a build through adb or app lab I ...
user avatar
  • 137
1 vote
1 answer
61 views

Unity hierarchical state machines and SOLID principles questions

i was wondering if you could help me out with some confusion i have over state machines and SOLID principles! sorry if the post gets too long, i'll try to keep things simple! So i have a huge player ...
user avatar
0 votes
0 answers
24 views

How do you track a 3D model of a building for navigation in Unity and AR Foundation?

In AR Foundation, you can track planes, feature points, etc. Is it possible to create a 3D model of a space to scale (in Blender, for example) and use the tracking features of AR Foundation to align ...
user avatar
0 votes
1 answer
32 views

Synvar not syncing when Instantiating gameObject

I am instantiating a gameObject server-side using the code below. The problem I am facing is that the SyncVar "PlayerUnit" is null on the client, even though I referenced a networked ...
user avatar
0 votes
0 answers
23 views

Download a video to PersistentDataPath in Unity while also playing it as it downloads?

I am attempting to integrate a video function which will playback short looping videos (similar to YouTube Shorts or TikTok). I therefore want the videos to download to PersistentDataPath and be ...
user avatar
  • 197
0 votes
0 answers
36 views

What are some strategies for handling multiple sources of control on a given entity?

Let's say I have a character controller on my player that is typically controlled using a script that reads human inputs and manipulates it using those inputs. But what if I also have a scene in my ...
user avatar
0 votes
0 answers
33 views

Using different hurt animations for different Melee attacks

I am currently trying to make a beat them up 2d game for learning purpose and was trying implement a combat system where if player hits with slash attack then enemy will be playing let's say "...
user avatar
  • 1
0 votes
1 answer
9 views

How to Force Refresh Texture2D/Sprite when Programmically Modified using Editor Script?

Here is some code called using a custom button in the component inspector: ...
user avatar
0 votes
0 answers
19 views

Animator parameters disconnect with node graph in Unity

I'm doing some tutorial and I have some parameters in the animator and the same parameters in a node in the node graph (if that's what it's called). And sometimes, but not always, there seems to be a ...
user avatar
  • 213
1 vote
1 answer
55 views

Visual Joystick moving faster than my finger. why?

First of all, here's the video of what my problem really is. (Sorry for bad quality) As you can see, the red circle is the center of the visual joystick. The green one indicates my finger and the ...
user avatar
  • 639
1 vote
1 answer
25 views

HDRP indoor scene has no diffuse indirect light

The lights in my indoor scene correctly produce direct illumination, but no indirect diffuse illumination. So the areas that aren't directly lit are completely black before exposure/post-processing. ...
user avatar
0 votes
1 answer
44 views

Player is able to interact with objects but enemy isn't able to

Newbie here, I have a player script that interacts with objects just fine and I made an enemy script for the same object and it gets completely ignored: Below there are 4 scripts. The ...
user avatar
0 votes
1 answer
62 views

Rotating dials with increments, one works and the others doesn't. Why?

I have 4 dials that rotate by increments when the players drag them. They all exactly have the same code, but I can't figure out why only one of the dial works as intended (dial 2). My code stops ...
user avatar
0 votes
1 answer
19 views

Apply an offset to a camera rotating around an object

I have a camera that rotates around an object to simulate the rotation of this object. To do this, I simply move my camera to the object before making my rotation and then translate it back: ...
user avatar
  • 1
1 vote
1 answer
60 views

How to implement a dial control that snaps to increments?

How can I implement snapping via code? I have this 2d circle that the players rotate via drag and it works like a rotating dial. The best way to describe what I wanted to achieve is similar to a clock ...
user avatar
0 votes
1 answer
47 views

Bottom-left cell position is incorrect?

I need to get the position of the bottom-left cell on my tilemap. I used Floor.CellToWorld(Floor.cellBounds.min) (Floor is the name of my tilemap) and I used Gizmos ...
user avatar
  • 639
0 votes
1 answer
37 views

3D CharacterController ride moving platforms in Unity?

I have a player controller script that I'm writing that uses the CharacterController component to move around and handle collisions. I've been able to implement ...
user avatar
1 vote
1 answer
75 views

How do I implement this distortion ripple effect?

I would like to implement the following running effect in Unity. When the player character moves, it creates some sort of rings around it to give the impression of high speed. I have searched for ...
user avatar
1 vote
2 answers
52 views

How should I implement the idea behind this abstract class setup in a Unity-Friendly/Inspector-Usable way?

First up, the name of the question is terrible and I am open to suggestions. For context: I'm still relatively new to C#/Unity and it's hard to ask questions properly when I don't know the terminology....
user avatar
0 votes
0 answers
26 views

I am looking for a flexible way to rotate a gameobject around another

I try to make an object rotate around another object on mouse input. In order to achieve this I used this code: ...
user avatar
0 votes
0 answers
31 views

How should you scale objects in a miniature world?

I'm extremely new to game dev, so I hope this question isn't too subjective, but when you're making a game with a miniature scale, what is the "right" way to deal with object sizes? Think &...
user avatar
  • 165
0 votes
0 answers
10 views

Why can't i add my Player from the hierarchy to that prefab? it shows the "block" cursor sign [duplicate]

I need this object to look at my player when it got spawned in. I was told to use "findobjectofType" but I also got told that avoid using find. Is there an alternative?
user avatar
-2 votes
2 answers
53 views

Collision callbacks not working

I'm a beginner at coding and wanted to make a quick little program to test my googling skills so far. I'm trying to make the player GameObject be given a speed boost when it collides with the "...
user avatar
0 votes
0 answers
19 views

How do I instantiate on either side under the same method?

...
user avatar
0 votes
0 answers
38 views

Datatype for procedural terrain generator

I'm making a kind of infinite runner style engine. It generates the terrain in chunks each time a milestone is reached, and stores each chunk as a custom class in a list. To minimize overhead, it only ...
user avatar
0 votes
0 answers
27 views

How to stop character animated with animator controller from moving to the origin when transitioning back to the walking state?

The problem is the transition from the state Catwalk Walk Turn 180 Wide R 0 to the state HumanoidWalk. This is what is happening ...
user avatar
0 votes
1 answer
34 views

Unity reference randomly becomes null

This issue has stumped be for 2 days and I still can't figure it out. I have a leveling script that references and image and subscribes to a global event. ...
user avatar
  • 63
3 votes
2 answers
1k views

When should I store a reference to a component instead of searching for it?

In the code I'm doing, I usually use global and local variables, as recommended. If the variable is not going to be used in more than any method, I make it local, otherwise, I make it global. In ...
user avatar
0 votes
0 answers
20 views

How to apply a texture to a Bézier curve-based mesh

I have an object that I originally made using a 2D Bézier curve which I turned into a mesh and solidified in Blender. However, now whenever I try to apply a texture to the concrete plinth, it applies ...
user avatar
0 votes
1 answer
39 views

Why doesn't MeshCollider work in a build?

I have MeshColliders in my scene that are shaped like an hourglass and it works perfectly fine in the editor. However, once I build on XCode and test on my iPhone, ...
user avatar
1 vote
1 answer
90 views

Trouble adding to a dictionary using a for loop

I'm trying to create a hotbar system where you can press 1 through 0 to activate abilities placed in the hotbar slots. Instead of a giant block of if/else statements I want to make a single check that ...
user avatar
0 votes
1 answer
15 views

Converting local rotation data from one rig onto another of a different orientation

I have an animated object which consists of a set of linked transforms. Think of them as bones. This object is animated - external to my software - and an API streams the local rotations - as ...
user avatar
  • 161
0 votes
1 answer
31 views

How can I rotate my BoxCollider2D 360 degrees around other colliders while maintaining a constant forward direction?

I'm trying to get my 2D character to rotate around colliders based on the current ground normal (sort of like in Mario Galaxy) detected by Physics2D.CircleCast, ...
user avatar
-1 votes
1 answer
42 views

How to detect objects within a radius without using a trigger collider?

I want an object to run code that detects objects around them, in a specific radius. BUT I cannot use a trigger... or any game objects or components. What could I do just using code?
user avatar
0 votes
0 answers
16 views

Trying to position all chunks for distinct LoD levels

Well, my question is pretty simple to understand, I'm trying to create a grid of chunks but on each step, I want to double the distance of a chunk. Then, this is the code I have: ...
user avatar
  • 141

1
2 3 4 5
305