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
2answers
54 views

How to layer two textures in a cylinder without Z-fighting?

In the documentation of ShaderLab culling and depth testing you have the following: Offset Offset Factor, Units Allows you specify a depth offset with two parameters. factor and units. Factor ...
0
votes
2answers
58 views

How to add time delay in Unity C#

So I'm trying to make a camera zoom in, but Thread.Sleep doesn't work. Here is the code: ...
0
votes
1answer
21 views

Problem with Parameters for polymorphism class

This is going to be a bit tricky but it is really bothering me so I hope you will have the patience to follow along :) Here is my very basic architecture: So in the framework, I am creating I have <...
0
votes
0answers
13 views

How to “undraw” a SetPosition on LineRenderer?

I'm animating the SetPosition on a line renderer to show a laser site quickly "spin up" so the user sees the laser head outward. I'd like to do the reverse and when a user switches off the ...
0
votes
1answer
20 views

Applying velocity to parent that ignores children's mass not working

I am making a VR data visualisation app in Unity and I have a parent with many children (just some primitive cubes) that I can toss around the scene by just setting the parent's rigidbody to the same ...
1
vote
1answer
26 views

Is it possible to somehow change the collider points to match sprites during the animation in Unity?

Is it possible to somehow change the collider points to match sprites during the animation in Unity? I am using the Unity built in animtion recording feature. I would like to change the points of some ...
2
votes
2answers
53 views

How to organize GameObjects into logical groups in a Unity Scene?

Obviously there are a Scene hierarchy, but the problem is that the scene hierarchy was not meant for organizing GameObjects because parent GameObjects affect the transformation of their children. For ...
1
vote
0answers
16 views

Unity Project Settings: What is the difference between “Graphics -> SRP settings” and “Quality -> Rendering -> URP Asset”

As the title says, I am a bit confused about the aspect that the URP asset is referenced from two different settings: "Project Settings -> Graphics -> SRP settings" "Project ...
-1
votes
1answer
11 views

movement of 2d object [closed]

I was trying to move object by changing velocity ...
0
votes
0answers
12 views

Rotate an object's scale according camera Y rotation?

I have a circle-shaped object to which I want to apply a scale of 2, 1, 1. Then I would like to rotate this scale according to camera's Y axis. Let me explain with ...
0
votes
1answer
20 views

My Circle Collider 2D cant passthrough Edge Collider 2D

I'm trying to make Flappy Bird but when I put an EdgeCollider2Don the Pipe, the bird can't pass through the collider and gets stuck. Bird code: ...
0
votes
0answers
24 views

How to have 3d multiple planet gravity in unity c#?

Im using unity and I want to make a game where you can walk around small planets and the further away you get, the weaker the gravity, so you can go to other planets. All the tutorials so far only ...
0
votes
0answers
19 views

Night cycle object not going smootly when object instantiated

Hello so I'm adding night cycle to my game it's going smoothly for object except the instantiated one as you can see that is a different color on it. so here the script for night cycle: ...
0
votes
0answers
21 views

My shader is making objects black constantly

I am procedurally generating a world. I want to apply a shader to each mesh, before i try textures i'm attempting to get it to work with colours. So i have a struct which stores data about a type of ...
1
vote
3answers
65 views

How to Make Border of 2D Game in Unity

I have a border by default. But, I'm having trouble detecting if my object collides with the border. I am looking for efficient ways to do this, and I am not sure what should I use. I thought using a <...
0
votes
0answers
19 views

I cannot see gizmo to move the object. How can I see gizmo?

I want to move an object. I select the object and click 'move' icon but I cannot see gizmo. So I cannot move object. (I also clicked 'rotate' and 'scale' but I still cannot see gizmo) What should I do?...
0
votes
1answer
27 views

Leaning with Player Controller

I'm adding leaning to my player controller and I can't find out how to stop the rotation overriding the tilt ...
0
votes
1answer
27 views

OUT.worldPosition effect on shader

I am trying to follow a shader tutorial from 2016 for unity. I reached the point where the author is distorting the text by changing OUT.wordPosition ...
0
votes
1answer
20 views

Unity display my generic list in the editor

I have the following class: ...
0
votes
0answers
16 views

How do I make function on user clicked on close button Ads reward?

So I'm here want to make function when the user closed the Ads before video ads end, the function is stopping or revert, in this case, I'm using ienumerator methods, but I don't know how to add the ...
0
votes
1answer
30 views

How to move through a game object - while getting the normal of the initial contact

In Unity, how can I detect a collision between two game objects, but have them pass through one another, i.e. not block each other? Specifically, I need the collision normal provided by the ...
0
votes
0answers
32 views

Unity rigidbody velocity

In Unity, what is the correct way to move a game object by modifying the velocity of its rigidbody? I'm having some issues with stuttering movement, so I just want to make sure I understand the basic ...
0
votes
0answers
26 views

How do I stop my gun from pointing at the player?

I'm making a game where you shoot enemies in Unity, but I can't figure out how to stop the player from pointing the gun at himself. I've tried detecting if the gun is on the left side of the player ...
0
votes
1answer
56 views

How to make my player move forward?

PlayerMovement.cs : ...
0
votes
1answer
24 views

Capsule getting stuck on edge of block

I'm making a first person game and when I jump and my character gets close to the top of the wall, the vertical movement stops, jitters, or suddenly snaps to the top of the wall. Video Here is my ...
0
votes
1answer
7 views

Layer Problem After Build&Run

I finished my game and it runs fine inside Unity. I exported it to WebGL and ran it there but the main menu background does not show. It looks the background color and is pretty annoying. Here are ...
0
votes
0answers
14 views

objects are keep falling [duplicate]

I added some screenshots above. When I run the game obstacle are falling rapidly through y axis. So, there's no more obstacle in that ground. If there's ground than ...
0
votes
1answer
16 views

HLSL Converting View Direction into Equiangular UVs

In Unity, I am attempting to create a custom skybox that use a single render texture to create a flat unmoving skybox (the render texture source will do it's own movement) and reflect off objects as ...
0
votes
1answer
40 views

Build and Run results in an empty window

Out of nowhere my builds are broken. The .exe just always gives me this little blank window but it runs fine in the editor. Here are some things I have tried: Deleted the previous build files ...
0
votes
0answers
9 views

Unable to get accurate y position on terrain to spawn object

all I am trying to spawn some crabbies and can't seem to get an accurate y height to spawn. I have a terrain created with GAIA Pro 2 and have tried a few things to get an accurate y value. When trying ...
0
votes
1answer
20 views

Character falls through the Platform Effector 2D in Unity. How can I fix it?

Character falls through the Platform Effector 2D in Unity. How can I fix it? Here is the demonstration: https://imgur.com/G5YkTxa. I tried changing the Edit - Project Settings... - Physics 2D - ...
-1
votes
1answer
88 views

How to stop objects from falling down?

As you can see, objects are falling down when I run the game. Ground is unable to stop those obstacles. Obstacles are rapidly ...
0
votes
0answers
17 views

How can I legally allow modders to use my tools that are dependent on licensed assets?

I am making a moddable game with Unity. I actually have working system for serializing/deserializing items etc. For purpose of easy item creation in Unity, I made editor-only windows that help you ...
0
votes
1answer
26 views

How to change a variable in the spawnpoint from another prefab

I refer the website for proper way of referencing the script How to call a public function from another script in Unity? but it does not work, still return a nullreference exception in the example ...
0
votes
1answer
23 views
0
votes
0answers
11 views

How to adjust Unity banner ads for IOS?

I'm using Device Simulator from the package manager to test on mobile devices. I'm using a banner ad at the top center with the code ...
0
votes
1answer
19 views

Accessing enum value in other scripts

I am attempting to make a global MaterialAssign script that I can assign to anything and have an enum selector in the inspector ...
-1
votes
1answer
28 views

Cant get all children using foreach and getcomponent

I am trying to get the component CheckPointEnemy from each child object from an array of transforms, and then add those components to a list of CheckBehaviours. ...
1
vote
1answer
27 views

Asset opening wrong unity version

I'm trying to open one of my assets in unity via my browser, but when I click open in unity it opens the 2017 version, when I want to add it to my newest one. How do i get this to work? (I need the ...
0
votes
0answers
12 views

Rendertexture skips channels sometimes

When rendering a camera to a render texture (for a portal effect), it seems to under certain circumstances skip rendering the red channel entirely. I cannot put my finger on why this might be ...
0
votes
0answers
6 views

What approaches are there to blending multiple terrain types? [duplicate]

So for my university final assignment I'm doing a procedural world generator in unity. The idea is that different types of terrain are generated such as ocean, swamp, hills etc. I have the different ...
0
votes
1answer
28 views

Why aren't the changes to the transform being applied?

I don't understand why this doesn't work. The code only acts when I press "Horizontal" buttons. Here's the code: ...
0
votes
0answers
23 views

Why my object Triggering too far?

I have some issues with detecting the collision when OnTrigger2d, as you can see in my screenshot below, that actually too far from the object. this my script ...
0
votes
0answers
22 views

Why is my color on my obj not showing in Unity!

I've been trying to import my full-color obj files to unity for a while now, but I can't get them to be in color. All of the colors show up in Meshlab, but not in Unity. All of the youtube videos I ...
0
votes
1answer
46 views

How do I make a part of my map off limit?

I'm looking for a common way to make zones in my 3D map "off limit"? The kind of thing you see in eg Hitman games where NPCs will get suspicious if you step into certain areas. Will need ...
2
votes
1answer
83 views

How to draw grass sprites without using gameobjects?

I am making a rimworld-like procedurally generated 2D game using Unity's tilemap system. Just like tiles, I also have to procedurally generate grass and trees. Each grass instance should have logic ...
0
votes
0answers
12 views

Unity Lerping & Following Camera is too slow

I'm using this script to follow a game object in 2D : ...