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
1
vote
0answers
31 views

Unity Input System - The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine'

I've just installed the Input System Package in Unity. Visual Studio Code is not recognizing the InputSystem namespace on the line using UnityEngine.InputSystem;, ...
0
votes
0answers
14 views

How do I distinguish a network of triangles connected by only 1 vertex as separate meshes?

I'm having trouble figuring out an algorithm to do this. It also seems to be very performance heavy potentially. I'm currently using Unity's Mesh component for this. In this example, I want triangles ...
1
vote
0answers
16 views

Sumo with Unity - Generate osm file of 3d model

I am working on SUMO with unity using this open-source project. But stuck in a problem: The background is, we need an open-street-map compatible 3D model in unity. I mean the model should be the same ...
0
votes
1answer
26 views

How can I add ease in out for object rotation?

Now when I set the rotateText flag to true the object will rotate on the y and then when I set the rotateText flag to false the rotation will stop and the object will rotate back to it's original ...
0
votes
0answers
16 views

How to fix image bleeding in front of canvas element [closed]

Unity 2020.3.25f1 URP So, for some odd reason (Only on one of my activities) I'm getting this weird tearing/bleeding issue of a game background image appearing in front of some canvas element buttons. ...
0
votes
0answers
22 views

How to find the last visited waypoint and the next waypoint?

I'm trying to make a ping pong mode for the waypoints. when I'm pressing the P key I want the transform to move between the last visited waypoint and the next waypoint. for example, if the transform ...
0
votes
1answer
32 views

Ball's spin speed seems to change erratically after AddForceAtPosition impulse

I'm trying to make a billiard game, and trying to add "spin" (aka English) functionality. The way I'm using to add spin is by using AddForceAtPosition(). Here's the code: ...
0
votes
1answer
31 views

How do you determine if a texture is primarily dark or light?

Particularly, how do you implement Color.GetBrightness (?) ...
0
votes
0answers
9 views

How do you apply HistogramEqualization to a Texture in Unity?

Trying to convert a c# snippet that uses LockBits, marshals and strides to be used to do a histogram equalization operation on a texture in unity. I'm not sure where it's going wrong exactly or how ...
0
votes
0answers
43 views

I can't add the change I made while the game is running to the list?

I realized that my problem has nothing to do with tilemap or something so I need to update my question.CalculateAgain() In the script below, I run the ...
0
votes
0answers
22 views

Unity HTTP webrequest is very slow on localhost

I'm working on an online game on my computer localhost. to do this I use Xampp. Anyway, my problem is that the UnityWebRequests ...
0
votes
1answer
20 views

How to apply brightness/contrast adjustment to a texture's pixels?

I'm trying to use a non-shader method to convert a (single-frame) Texture2D to one with different brightness/contrast. Attempt so far uses: https://stackoverflow.com/posts/15408608/revisions I'm not ...
0
votes
1answer
34 views

Problem load data from playerpref

So I want to make a merge idle game, but I have a problem loading data from playerprefs, I have an item that I bought from the store so ...
0
votes
1answer
20 views

Need help with locking the Y axis on camera

I am working on a small 2D platformer in Unity for my school project and I would like to lock my camera on Y axis (so it can move horizontally, but when the character jumps it doesn't follow the jump)....
0
votes
0answers
16 views

Unity: basic problems with avatars, rigs and animations

I am having a problem with my animation hierarchies. The way my characters are structured are as follows: I have an empty gameobject as the parent, on which i put all of my scripts and components - ...
-1
votes
1answer
31 views

Why the transform is never moving and reaching the last fifth last waypoint?

I have 5 waypoints ,each waypoint tagged and named as "Teleporter". The Mover the blue cube is start moving to the first waypoint and then should move between all the other waypoints. but it'...
0
votes
0answers
22 views

Why is my blender 2D ring so pixelated when imported into Unity?

I created a simple ring in blender, yet when I import it into Unity it is horribly pixelated and choppy looking. I want the ring to look perfectly smooth. In blender, I selected the "shade ...
0
votes
0answers
25 views

Unity Pixel Perfect Camera - parented sprite's children begin to jitter

I currently have a setup using the pixel perfect camera, and found that child sprites moving their localposition begin to jitter if their position is in a decimal point over the hundredths. Designing ...
0
votes
1answer
42 views

Dust trail when character runs

I'm making a 2D top view game (same perspective as the game Forager) in Unity. I want the game to be visually appealing, and want to add some details like dust particles. Whenever the character moves, ...
0
votes
0answers
4 views

Unity BuildAssetBundles: build all files at once vs. build one at a time for large amount of assets, which is better?

I need to build the unity asset bundles for a very large amount of assets. When writing my code to do exactly that, I found out one can give a buildMap to the BuildPipeline.BuildAssetBundles function ...
0
votes
2answers
40 views

prefabs not aligned at same horizantal level after instantiating

I have generated a logical grid and trying to place a prefab on top of that grid. Piece is the base class for all pieces Pieces[]...
0
votes
1answer
18 views

How can I tint the color of a decal in Unity?

For my game, I want some sort of indicator of if a space is walkable or not. To achieve this I figured I would create a decal projector and have it follow the mouse cursor around, displaying a decal ...
0
votes
1answer
25 views

Capturing hard movement from one side to the other on thumbstick

I am trying to implement a hard pivot, like in Mario game, where the character is moving in one direction then you move the stick in a hard 180 to trigger the pivot animation. My problem is that I ...
0
votes
0answers
15 views

Cinemachine lock on

I'm using Cinemachine for a free look 3rd person camera and a virtual camera for a lock on cam. I already have switched Cinemachine brains and movement types done, but I need the player to face the ...
0
votes
0answers
52 views

How can I force my Navmesh agent to only move four directions? (for 2D)

I'm making a 2D game in Unity. For 2D I am using the NavmeshSurface2D-plus master package available on github. My enemy object is chasing my main character nicely, it's ok. I set my main character to ...
0
votes
1answer
36 views

How can I cache and read fields on non instantiated prefabs?

Let's say I have a very simple 2D square prefab that has a script like this attached to it: ...
0
votes
1answer
39 views

How to add delay to the moving objects?

Now all the moving objects are moving like a group to the same target. I need them to move to the same target but with a delay between them. The first object start moving to the target after X seconds ...
0
votes
1answer
14 views

Clarification of functionality of Vector2.MoveTowards method

In Unity's documentation for Vector2.MoveTowards, they assign a two variables, "speed" and "step". "step" is simply speed * Time.deltaTime. Why is this step variable ...
0
votes
0answers
34 views

Unity code design - Events

I am aiming to create a Unity project with a code structure similar to ECS. I want the code to be consistent, easy to integrate extend and expand if multiple developers will work with it. By that I ...
0
votes
1answer
29 views

Slowing down mouse movement in Unity

I'm using the game to control electronics. I use the following code to determine the location of an object (the location is used to perform calculations that are sent to the electronics) ...
0
votes
1answer
35 views

What is the best way to present "rate this app/game" with unity/c#?

I want to give my users a chance to rate my game at the Google Play Store. How can I achieve this on Unity/C#? I would like users to be able to rate instantly inside the game window without being sent ...
1
vote
1answer
62 views

Unity custom editor - nested Property Drawer is getting Enum names for the parent property, instead of the child

I have a class, EnumMap<TEnum,TValue>, for associating each member of an enum type with a value of a given type, since I find myself running into situations ...
0
votes
1answer
21 views

How do you get the texture coordinate hit by the mouse on a UI Raw Image in Unity?

It seems raycast hit does not work for UI... is it possible to get the .textureCoord of a point hit by the mouse on a UI raw image? (raw image provided by a render camera elsewhere far far away)
0
votes
0answers
15 views

How to stop animation state normalized time to go beyond 1

I want the animation state normalized time not to go beyond 1 when it is not looped. I initially thought that it shouldn't do it anyway but the longer the animator stays in that state, normalized time ...
0
votes
1answer
35 views

How can I update the Navmesh path in 2D games?

There are destructible and indestructible objects on the map I created with Tilemap, and I create a walkable area (bake) for my enemy object using the information I found on the internet and the ...
0
votes
1answer
28 views

How to stop Sprites from stretching on Mobile with different aspect ratio

On Unity 2020.3.24f1: I created a 2D Core Project and changed to build on any Android device. Added a simple 2D Circle Sprite to my Scene. The Problem: I want my Game to run in 9:16 aspect ratio all ...
0
votes
0answers
30 views

How can I fade in out object/s?

In general the main goal is to teleport between teleporters with fade out/in when teleporting. but for testing the Fade I call the Fade method once in the Start : ...
0
votes
0answers
7 views

Should I use Unity Canvas for non-UI game objects? [duplicate]

I'm trying to do simple card game. I want players to drag and drop cards from hand to table, from deck etc. The simplest and cleanest solution for drag and drop I found is to use Image object on ...
0
votes
0answers
17 views

How do I send a push notification for a friend request for multi-Player game in Unity using Playfab+photon

So here I am trying to convert my single player game into multiplayer game. I am able to work the part where the user can login to the game using Playfab via Username. I am able to create a friend ...
-1
votes
2answers
51 views

Why can't I stop Coroutine?

...
0
votes
1answer
24 views

How to change size of a SINGLE tile on a tilemap at runtime?

I'm having trouble figuring out how to change the scale (size) of a single sprite (tile) on a Unity Tilemap. In the game, I place trees as tiles on a tilemap, and when they grow over time, I want to ...
1
vote
3answers
100 views

Unity2D Grid-based Sprite Movement and Tilemap Collision

I have just started working with Unity2D to simply learn how it works. I've been trying to get grid-based movement and collision with a tilemap working, and it's mostly there, but there's one bit that'...
0
votes
0answers
25 views

Why can't I achieve the full native mobile Android screen resolution in Unity? Screen resolution in app is throttled to 1080p

I have been building an app in Unity using the UI Toolkit (UI Elements) but I am encountering a strange phenomenon. I am testing on a Samsung S21+ which allows resolutions of 1600x720, 2400x1080, and ...
0
votes
1answer
13 views

Random noise is creating sporadic vertices' to mismatch

I'm using a constant seed value for my random number generation, so that results are consistent each load. This example is boiled down to just the height value of the Vector3's I'm using since that's ...
0
votes
0answers
42 views

How to implement crowd movement in Unity without rigidbodies?

I am working on a mobile game where its core gameplay includes a bunch of objects (can exceed 100) walking around autonomously in an environment where they push each other and get pushed by other ...
0
votes
1answer
30 views

How to use AddComponent to add an instance of the derived class, not the base class that defines the method?

This is my base class ...
0
votes
0answers
13 views

When using animator state with parameters conditions type trigger it's working only for the first but why it's not working for the second?

In the Animator Controller I added a new state with animation the idea is to make a smooth transition between the idle to the new state animation. The first transition is using in the conditions the ...
1
vote
0answers
55 views

Odd behaviour from parallax

First of all I'm going to say that I'm not trying to blow my own trumpet or anything but usually I'm able to figure this stuff out on my own. But as for now I'm fully stumped. Maybe I'm having a mind ...
0
votes
0answers
26 views

High rigidbody drag value gives weird speed readings

when calculating speed in unity ...