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
11 views

What tool to develop a 2D clickable objects riddle game? [closed]

I want to develop a 2D game with multiple scenes. Each scene is a static 2D background with some objects on which the player can click to solve a riddle. I am planning to have approximately 10 scenes. ...
1 vote
1 answer
11 views

Made a new camera in unity 2d, its now the default despite not being set to main camera

I created a new camera in Unity 2d and for some reason its being set as the main camera despite not being tagged as such. The original main camera is in fact tagged as "main camera" but it ...
0 votes
0 answers
22 views

Why do Unity UI toggle groups update *after* the default time in Execution Order settings?

Why is toggle group after default time in the default script execution order in Unity?
0 votes
1 answer
583 views

Changing Ambient Light settings in Environment window does not affect scene after baking LightMap

My settings: Unity version - Unity 2021.1.12f1 Lightmap Lighting Mode - Bake indirect Render Path - URP I want to change Ambient Light in Environment window while I have baked LightMap. Is it possible?...
0 votes
1 answer
352 views

Facing Arrow on right direction while launch

Hey guys I've been making a bow and arrow system. I'm stuck on making an arrow facing the right direction before its launch. I've attached 3 arrow prefabs in the right position of the player's hand ...
0 votes
0 answers
23 views

Frustum culling works correctly but results in flickering meshes

I've written a C# code and Compute Shader that makes frustum culling and it works correctly but it makes the grass flicker. I can't figure out what is behind this issue so I'm asking here. Does ...
0 votes
0 answers
26 views

How to multiply a vector4 with matrix4x4 in Unity?

If I would like to multiply a Vector4 with a Matrix4x4 in Unity, what method can I use? I have only found ...
0 votes
0 answers
29 views

How do I create Mining System like in DomeKeeper / Wall World?

TL;DR - I want to create a mining system like in Dome Keeper / Wall World. I'll start with the fact that I'm new to gamedev, and i did a wholeday of research before writing this post. I want to ...
0 votes
0 answers
20 views

How can I change the default UI shown by Photon Fusion?

When I start a Photon Fusion game, I see by default the following dialog box: I want to change it, e.g. by removing some options, adding color or text, etc. I searched for "photon fusion lobby&...
0 votes
1 answer
209 views

How do I draw a ray in Unity?

I am trying to scrape together something for VR in which the locomotion is based the player holding the direction where he wants to go to (basically planning what he is going to do). While the player ...
4 votes
2 answers
13k views

What does "Write Defaults" in the animation state inspector actually do?

In my Unity project, I had an issue recently where a tool which autogenerated animation controller layers caused issues with existing layers because it was generating layers with Write Defaults set to ...
0 votes
1 answer
500 views

Extend distance for rendering grass and tree objects on terrain

I am trying to make an adventure game with a big landscape (made the terrain with terrain tools) with 3D models of grass (that I placed using terrain tools) but it only shows the grass/trees that are ...
2 votes
1 answer
543 views

How to rotate a 3D object based on stick Input and the normal of the ground's surface?

I am making a game where I want to view an object from any angle and use an analog stick to rotate it according to this input and the surface the object is currently resting on. Here's a visualization ...
1 vote
0 answers
43 views

When making an object that interacts with things, is it better to have one big script or several different small scripts [duplicate]

Im working on a game inspired by Buckshot Roulette but medieval themed, in Buckshot Roulette the weapon can be picked up by the player, who can then point it at themselves or the "dealer", ...
-2 votes
2 answers
1k views

C# syntax for "This button is interactable"?

What should be the C# syntax for the condition if (This Button is interactable)? I have a script attached to the button, Which has to run only if the button is interactable. Thank you in advance!
0 votes
0 answers
32 views

Frustum culling using compute shader, how?

I'm working on a little project for a while - creating an area where you can spawn a bunch of grass. I've overcame a major headache when figuring out the GPU instancing for the mesh and the code looks ...
1 vote
1 answer
1k views

Communication between Photon Cloud game and web server

I am creating a multiplayer game using Photon Cloud (Photon Unity Network). For storage of player data (profile, inventory, achievments) I use web server (asp.net mvc & sql server). How to ...
0 votes
0 answers
59 views

How do I start this game? New to coding (1st Game) [closed]

I am entirely new to this, but I want to participate in a game jam. I have time on my hand, and I want to learn. The theme of the jam in Growth and I have two weeks to do it. I am primarily a writer, ...
0 votes
1 answer
25 views

Unity Canvas on Quad blocking mouse click sometimes?

I'm working on a card game that has quads with world space canvases on them. I've been using OnMouseOver() and ...
0 votes
0 answers
35 views

How to import files that are not included in the project by checking that they do not exist?

I want to check whether the files exist, as in the window that opens when importing asset from Package Manager, and copy them into the ...
0 votes
1 answer
23 views

Displaying Precisely Scaled Images With URP Decal Projector

I am using Unity's URP Decal Projector to display an oval shaped blob shadow texture. The image's dimensions are 227 x 70. However, when I use it as a base map for my Shader Graphs/Decal material, it ...
0 votes
1 answer
37 views

Motion Retargeting from a BVH File to a Rigged Mesh in Unity with Arbitrary Rest Pose

I want to perform motion retargeting from a .bvh file (from lafan2 dataset) to a rigged mesh in Unity (which is John Lemon in this tutorial resource). I have overcome most of the problems, but this ...
2 votes
2 answers
2k views

Strange shiny reflection on terrain

So I'm trying to figure out, what's causing this strange reflection on my terrain. I've tried almost everything to get rid of that shiny circle, but to no avail. It follows me wherever I go, so it's ...
1 vote
1 answer
812 views

How to use SmoothDamp with speed?

I have a moving platform which is being moved like this: ...
0 votes
2 answers
95 views

How to use Unity ECS without URP or HDRP?

Finally, DOTS is completely released with Unity's 2022 version, so I decided to learn it using the latest tutorial by code monkey. He is using URP for this project. My question is, URP or HDRP ...
1 vote
1 answer
62 views

How to calculate rotation needed to cancel out perspective shift

I have a direction vector that's pointing to (0,0,1) in local object space. How can I calculate rotation needed to rotate it on Y axis so that from camera's point of view it would look as if it's ...
0 votes
1 answer
36 views

Can I convert a Unity file with the extension ".asset" to ".prefab"?

I am using a Unity asset to combine many meshes of many objects in my scene to one object. The name of this asset is "Mesh Combiner", and here is the link to the asset: https://assetstore....
0 votes
0 answers
48 views

Terrain detail grass not receiving shadow

The grass painted onto my terrain is in the shadow area of the house wall, but they're not receiving shadows. Why does this happen?
0 votes
2 answers
3k views

Why does the object spawn only on client?

In my game I have an object, let's say food, that whoever consumes it, that player will spawn one more element. I am checking collision in Update. The following code is working fine on server side, ...
2 votes
1 answer
420 views

"ModelImporterClipAnimation" Settings don't get applied to FBX

I am trying to edit animation file settings in the FBX file. I managed to load the file and extract animation clip names using the code below, however, I am unable to actually edit any of the settings ...
0 votes
0 answers
30 views

The lighting result is wrong when switching scene in Unity

When I use SceneManager.LoadScene() to switch between scenes the result of lighting in loaded scene is wrong. However if I open the scene solely the lighting ...
0 votes
1 answer
62 views

Camera movement automatically tracking a tool over a surface

I need to create camera movement tracking the clipper hair like this: I already have a script for the movement of the tool. I'm using Snapping Player to the Surface of an Object of this pos How ...
0 votes
1 answer
337 views

Reconciling rotations with Unity and Blender (-360,360)

I'm currently working with Oculus integration trying to export headset (and eventually controller) position and rotation data to a CSV for later use in Blender. My issue comes from the way Unity (or ...
0 votes
0 answers
32 views

Isometric building system and coordinate calculation

I am a Unity newbie and trying to implement a simple building system in a prototype of the game. The scenario is: Clcik on the UI Button Move the coursor to the desired position Click left mouse ...
0 votes
0 answers
7 views

ProBuilder PivotLocation base center?

I'm trying to understand why ProBuilder only has FirstVertex or Center as pivot locations. Why not base center? How does one set the pivot to be base center of a mesh at runtime? https://docs.unity3d....
0 votes
1 answer
376 views

Unity detect drag to a game object

I want to detect when a UI object it dragged and released on top of a game object. The drags starts on a sprite on the canvas outside of the game object. I tried using ...
0 votes
1 answer
38 views

How to rotate a game object automatically based on the angle?

I need someone to help me think about how this works so I can implement this behavior in my game. Below is a video from a game that does exactly what I am trying to accomplish. An airplane that only ...
0 votes
1 answer
36 views

How to instantiate Capsule to always be facing another GameObject regardless of Capsule's world position?

I have the following line of code: ...
0 votes
0 answers
12 views

No PolySpatial option under 'window', project settings xr says there's no VisionOS plugins in XR Plug-In Management either

I'm running Unity 2022.3.20f1 and can't find any polyspatial options anywhere. I've gone through start up guides and Unity's official videos but nothing aobut why the options wouldn't be here..
0 votes
1 answer
408 views

Generating UVs for an annular sector/ wedge-shaped procedural mesh

I am using code to generate a mesh to show the firing arcs for a tabletop-style game I am working on. But when applying a material to it, I only get a solid color. Here you can see the custom mesh ...
0 votes
1 answer
29 views

Apple Watch Intermediary Script with Unity or Remake Game in Xcode?

there. I had a question that I keep finding dead ends to. Is it possible to create a Unity iOS project that has the ability to talk to a WatchOS app? I know that there's no current way to build it ...
0 votes
2 answers
1k views

Copying transforms from one object to another

I am working on a virtual production app, and I need to be able to copy the transforms of one GameObject and all of its children to another. I asked previously here how to animate a character moving ...
0 votes
1 answer
340 views

How is the default value of ContactFilter2D.isFiltering true?

I have a static ContactFilter2D like so: ...
0 votes
1 answer
29 views

How to get difference in rotation between 2 objects, but only on one axis

Say I have 2 cubes that start with the same rotation. I wish to track the rotation difference between the 2 about the z (forward) axis. Such that if cube A remains stationary and cube B rotates 30 ...
1 vote
1 answer
36 views

How to add samples with dependencies to Asset Store?

I want to add a sample to an asset published on the Asset Store in Unity. Sample has a dependency on the ...
0 votes
2 answers
2k views

How can I gradually increase the speed of my game?

I recently made a replica of (Dino run) game in Unity2d. But I'm stuck on how can I speed up my game gradually. Should the game speed be increased or should I increase the speed of the camera. ...
0 votes
3 answers
345 views

In 2D, how can I improve character rotation using raycasts when dealing with sharp/convex edges?

Edit: After making some edits to my polygon collider (based on @Alex F's suggestion), I can indeed confirm that sharp, convex corners are causing the buggy ...
0 votes
0 answers
45 views

Overlapping geometry (Z - Fighting) solution with shader in Unity

I have geometry that is overlapping with other geometry (the floor). So, I used a shader to bring my desired mesh to the top. However, a new problem arose: the shader was rendering not only on top of ...
0 votes
0 answers
20 views

Why is my NavMeshAgent Waypoint system not looping

I have a character moving along 5 waypoints and it should be looping, but for some reason the Update method stops after the character reaches the last waypoint. The output for currWaypoint is 0, 1, 2, ...
8 votes
1 answer
368 views

How to move a portion of bezier/spline curve along its complete bezier/spline curve?

Based on the image below, I have a curve (orange) which is a bezier sub-curve of an original curve (longer black curve). The original curve consists of a number of cubic bezier curves joined together. ...

1
2 3 4 5
327