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
1answer
24 views

Unity ScriptableObject Conversation Dialogue and Reading

I'm unsure as to how I would reference a scriptable object's variables within a struct from another class. I know I'd have to make a public Conversation, but I'm ...
0
votes
1answer
19 views

Problem importing Blender materials into Unity via FBX

I've created a simply low poly house in Blender (2.92) that I have imported into Unity as an FBX. Materials (simple colours) are all set up in Blender. Initially this was all working fine. Colours all ...
0
votes
1answer
20 views

Mark positions of spawnpoint in editor

I am creating a digital boardgame, which consits of muliple boards, between which the gamepieces are moved by the players. The script of the game board needs a 2D array of positions to know where to ...
-1
votes
1answer
25 views

The gun becomes invisible while running the game, how do I fix it? [closed]

The gun is visible in game view but not visible while running the game, this problem started occuring when I set the gun as the child of the main camera.
0
votes
1answer
19 views

How to make prefabs UI work on any canvas scaller?

I want to make my UI prefab working on all size of canvas reference resolution scaler because I already make one which is not prefab UI its work to all reference resolution but when I make it prefab ...
0
votes
0answers
57 views

How can I improve the current enemy spawning system for my strategy game

I'm currently making an RTS game for mobile where mini battles would take place on tiny battlegrounds. The problem is that currently the player is spawning its units based on a currency system, ...
0
votes
0answers
23 views

spatial mapping with realworld texturing hololens 2

For a project I'm trying to texturise the spatial mapping of the hololens 2 with photographes. I found a pretty good project witch made exactly what I want the problem is that is a Unity 5.6 / ...
0
votes
0answers
12 views

How to follow an object with the player without stepping out the waypoint line Unity3D?

How to follow an object with the player without stepping out the waypoint line? I added four waypoints with a debug.line and tried doing some simple waypoint mechanic. I wanted the object to move from ...
0
votes
1answer
31 views

Momentum-wise accurate player controls in Unity regarding collisions

First post here. So I am a newbie to Unity and am willing to create a general character controller script to base my future characters. I understand a character's mechanics are pretty design (UX) ...
0
votes
2answers
40 views

Coins are solid objects and I can't collect them

I am just starting out with Unity following along with this video, and I am stuck at roughly 1 hour and 54 minutes in: https://www.youtube.com/watch?v=pwZpJzpE2lQ It is worth noting that the video ...
1
vote
0answers
17 views

How to produce interreflections in Unity3d?

Notice how the "door" shown below appears multiple times in the reflections, both vertically and horizontally. These "extra" reflections are called interreflections. I am trying to ...
0
votes
0answers
16 views

game button animation lag with Photon

Friends, I am making games using photon. But I could not do the delay animation as described in this link. The action appears to be late on the player according to the ping. Can you give an ideas ...
0
votes
1answer
20 views

save generated gameobject to an array for shuffling

hey everyone i have this script here that breaks down a sprite into pieces and makes each one a gameobject.im having touble saving them into an array so i can shuffle them as gameobjects. ...
0
votes
0answers
13 views

Unity Android : Game Crashes on Release mode

One of my app in playstore getting to much crash report after last update and that's affect my users and receive negative reviews. I don't know exactly what is the problem, we have test app before ...
0
votes
1answer
14 views

Photon Transforms syncing other transforms

I have a problem wherein this happens: It's problematic because I'm unfamiliar how to set the same player value in the same transform over the network. Is there a way where if I get the list of ...
0
votes
0answers
19 views

Unity - using Colliders with custom objects

Hi so I'm quite new to Unity and currently experiencing issues with colliders, a quick summary of what I have. Player > ...
0
votes
1answer
64 views

Make enemy move diagonally in 2D

I'm making the enemy follow the player only straight or diagonally e.g.(1,1)(1,0)(0,1)(-1,1). I expected the problem that I have, but I don't really know how to fix it. When my enemy is placed ...
0
votes
1answer
11 views

How do I bring the console window back into the same Unity window?

I have this issue where somehow I accidentally got the console window separated from the window that all unity things are n, so it floats around, blocking the unity screen behind it, as shown below: ...
0
votes
1answer
12 views

Lights not displayed on Sprite

I have a scene that contains 3 elements: Main Camera A 2D Sprite that renders a single white pixel image, scaled to 2000 x 1000 A point light with a yellow color What should be done so that the ...
3
votes
0answers
48 views

Generate a 2D field-of-view cone

I have a bunch of randomly generated boids flying around on my screen, but I want a function that can give them a field-of-view where they can "see" other boids or obstacles. The code I ...
0
votes
1answer
23 views

When pressing both the key then releasing any1 key then the anination is not played

i give the running animation to the character and created a flip script...when press A then player move and flip to leff and animation is played ....when press D then player move and flip to write and ...
0
votes
0answers
45 views

How to manually kick players in new Unity Input System

Using the new Unity PlayerInputManager, I'm trying to create a page in the pause menu of the game where players can remove other players from the game. It's a ...
2
votes
1answer
40 views

Position Object always at the same distance of 2 other moving Objects?

I am making a procedural animation of a worm. I have already something working: (the green dot is the position Target, purple and red are the Head and the Tail of the Worm) I would like to add ...
1
vote
0answers
36 views

Unity: Record real time game play in high quality using offline rendering?

I'm looking to record Unity gameplay at really high quality (360 Stereo 8k 120 fps). I can't do this in real time due to the GPU resources required so I need to do offline rendering (frame perfect ...
0
votes
2answers
60 views

what is the math behind the parenting a transform in unity?

in unity when you parent an object or transform with another object, all transform(position, rotation, scale) are calculated depending on that parent object. sometimes we need to know about the local ...
0
votes
1answer
44 views

Unity 2d…Bullet Intantiate on left…but instantiate on right but not showing in game mode

I created the gameobject player and add script to it: ...
0
votes
0answers
35 views

Masking cameras for Voronoi splitscreen

I would like to mask a camera to only render to a certain (non-square) region of the screen, to be used as an overlay, for splitscreen, or any other application. The goal is obviously to prevent any ...
0
votes
0answers
19 views

How can I make sure that a component gets destroyed the last out of all components attached to an object in Unity?

How can I make sure that a component gets destroyed the last out of all components attached to an object in Unity? I have a component with some scripts on it: ...
0
votes
0answers
37 views

How can I switch the default map to UI in order to pause the game?

I've recently set up the new Input System using Player Input component and invoke unity events. I just have one problem; I want to change the default action map to UI whenever I press the defined ...
1
vote
1answer
93 views

How to connect the Data Layer (Models) with the Visual/Interactive Layer (MonoBehaviours)?

I have been struggling with this dilemma for quite a while already. Our game is complex enough that we have tons of logic in normal C# scripts that function very independently of any Unity specific ...
1
vote
1answer
42 views

How should I setup my sprites for 2D combat?

I was painting pixel sprites of a goblin (the enemies in the game). I first thought of making sprites of it for each different scenario: facing camera, moving toward camera 1, moving toward camera 2, ...
0
votes
1answer
33 views

How to avoid overwriting a value in Unity?

I'm working on a Tower Defence style game, and wondering how best to handle the "resources" part. I have multiple enemies on screen at a time, and when an enemy dies, it updates a resource ...
0
votes
1answer
32 views

File writing or scriptable object editing in unity webgl

I am using a scriptable object for saving data. I know that scriptable objects are unchangeable means we can't change and save data after runtime but is there any workaround available to update it? Or ...
0
votes
1answer
27 views

Checkerboard using Shadergraph

In Unity Shadergraph, how can I create a checkerboard pattern that works independently of the size of the quad that it is applied to? Here's what I got so far. Since I have set the Frequency to 10x6, ...
0
votes
0answers
53 views

Unity HDRP transparent material back-face rendering/front face culling

I try to render an object with 2 different transparent materials. One should only render the back faces (higher opacity/more color) and one only the front faces (lower opacity/less color). The purpose ...
1
vote
1answer
36 views

Tracking how many people play my Unity game in which language?

In my game the user can change the language of the game and I'd like to know how many people play it in English, German, etc. I'm using Unity, so possibly I would like to implement in Unity Analytics. ...
3
votes
0answers
33 views

Is there a standard way to rig a humanoid?

I am using some placeholder humanoid models for my game, which will be replaced later. I am concerned that when I replace them, they will not work with my animations, due to different rigging. Is ...
0
votes
2answers
47 views

How to make the snake bodyParts follow same places and directions as the player on a curved surface?

I try to make a game like the classic snake game but on a round ground (Earth). On a plane, the script works well, but when i moved it on a sphere, the bodyparts (prefabs), are not working good as you ...
0
votes
1answer
32 views

Why does my object rotate too fast?

...
0
votes
2answers
47 views

What's a code-efficient way to go about DB objects, DTO objects and actual objects?

Currently I have 3 different classes for the same type of entity. One is the main class that contains logic and everything the entity needs. Then I have a DB object, that has the same structure as the ...
1
vote
2answers
55 views

Button onClick in a menu prefab doesn't work

I don't seem to be able to make a reference to a Button inside a menu prefab. My menu prefab consists of a panel and the panel has 4 buttons. I added ...
2
votes
0answers
24 views

How to use HD and SD sprites in Unity addressables

I am able to load sprites using Unity addressables. But how can I use SD or HD variants of a sprite based on my device resolution? Previously I was using LIBGDX, and it has ...
2
votes
1answer
20 views

Can a MonoBehaviour be a private inner class? [closed]

I want to use a private inner class MonoBehaviour as part of the internal implementation of a class (also a MonoBehaviour). ...
0
votes
1answer
28 views

How can I disable an Animator from the Animation in Unity?

How can I disable an Animator from the Animation in Unity? The Animator enablement checkbox seems to be highlighted, which makes me believe that the enablement of the Animator is an animatable ...
0
votes
2answers
27 views

Spawning a customized sprite with text

I'm making a game where I have circles filed with words or pictures drop from the top of the screen to the bottom. they should spawn right above and then drop. I just started using unity a couple days ...
2
votes
1answer
144 views

How to detect collisions in Unity ECS?

I am creating a game using the new Data-Oriented Tech Stack (DOTS). I am using Entities with the PhysicsShape and PhysicsBody authoring components of the new Physics package. Some of my PhysicsShape ...
1
vote
1answer
49 views

Splitting up HLSL code into separate functions causes the number of needed temporary registers to increase

EDIT Per request I've provided a simple compute shader that reproduces the problem. The compute shader below is kind of a contrived example meant to compute the rolling average over an input ...
0
votes
0answers
17 views

Melee Range trigger collider does not detect object with Player tag

In my 2D game, I have a Player which has: a BoxCollider2D with isTrigger=false a dynamic ...
0
votes
1answer
42 views

delaying enemy attacks

I have an enemy attack script that when a raycast hits the player it deals damage to the player, however the enemy attacks at multiple times per second and I wish for the enemy to have to wait 1 ...

1
3 4
5
6 7
279