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

How an I find grid outer square positions by formula by script?

I mean automatic to find the outer grid square : ...
1
vote
0answers
24 views

How can I rotate my player towards a target without rotating the player to face the target?

In my code I play animation that make the player walking backward. Once the player is walking backward I want it to reach a target but not to be facing the target but to keep walking backward to the ...
0
votes
0answers
7 views

How do I keep root motion intact while changing Rig to Humanoid?

I have an animation with root motion. Here is how it moves: When I change the Rig from "Generic" to "Humanoid", it loses the root motion and instead walks in-place: How do I keep ...
0
votes
0answers
7 views

Unity TextMeshPro input text selection highlights programmatically

Is there a way to set the TMPro input text selection highlights programmatically (?)
0
votes
0answers
6 views

Weird anomaly with animator controller during testing

When running the game in the editor, my characters speed is not what the animator is set for. The speed is set at 2 at runtime but it moves considerably faster. Upon looking at the animator parameters ...
-3
votes
0answers
26 views

I need a script [closed]

Hi guys I'm learning unity nowadays And I'm using unity 5 because my laptop is not supported for latest version of unity i want to Add cinemachine to the project pls send me a camera follow script for ...
0
votes
1answer
15 views

Unity Build Automation

My current project has some editor scripts that I run just prior to run/build, which dynamically creates some game objects in my main scene based on configuration. I don't want these objects to ...
1
vote
1answer
24 views

What unity version should I install from the list? [closed]

The problem is that all my projects are in unity editor 2019 version and if I switch to a newer version I'm afraid it will start asking me for api changes and other changes that it will make to my ...
-1
votes
0answers
14 views

How do I get the gameobject of a script from a static void? [closed]

I want to access a certain gameobject in another scene. I am just trying different approaches to achieve this goal. I am just trying the following approach: I have placed the following script on my ...
0
votes
1answer
22 views

How do I load scene content but not show it until later?

In my game, I have A start up scene that has a 1 script. This script loads The inventory scene The first level I don't want to show the inventory scene, I just want to pre-load it. Therefore I have ...
1
vote
0answers
17 views

How to find names of variables on Unity components?

I’m trying to make a Distance Joint in Unity 2D. I have it set up and it works properly in the game. However, when I go to set the ‘Connected Rigid Body’ field through code, I can’t figure out what ...
0
votes
0answers
21 views

Build crashing on macOS (works on windows)

I'm currently working on porting a windows game to macOS and it was going smoothly so far, but I got to a point where the build always crashes at one specific area in the game. There was never such an ...
0
votes
0answers
44 views

UI detects different resolution after second app launch

I'm encountering the strange behaviour that my UI (canvas with some buttons) is looking differently after the second launch on mobile. Restart of the phone does not help. This does not happen in play ...
0
votes
0answers
15 views

Unity Light Bugs in Android

I was testing my game, so I made a build to test it on my phone. I noticed that when I play in an android build, it is so darker than when I play in the editor or in a PC build. It looks like this in ...
0
votes
2answers
25 views

Use Buttons based on Key Presses instead of Mouse Click

I have a UI button. I want a function to be called whenever I press a specific key on my keyboard while my mouse is hovering over the button. I want to make something similar to UI in Ark SE where you ...
0
votes
0answers
12 views

Blending / Lerping between textures in a Unity CG Shader

I can lerp between Colors just fine, but lerping between textures just doesnt seem to work? What am I doing wrong? ...
0
votes
0answers
41 views

How to make a shadow-casting day/night system in 2D URP?

I am trying to achieve a day/night lighting system similar to the game RimWorld. Short preview of what I want can be seen here: https://giphy.com/gifs/VgzcwtjueP7BrYSrXe Instead of using Global Light ...
1
vote
0answers
19 views

Why do my textures make randomly colored gaps?

So in unity, I use a palette to paint a texture, but they create randomly colored gaps like this: Why is this? Thank you in advance!
0
votes
0answers
30 views

HUGE 2D worlds in Unity (like spaceflight simulator)

I am a beginner in the field of game development and I am having some doubts regarding some stuff... I am trying to build a 2D space-rocket-orbit game like the Spaceflight Simulator and I'm not able ...
0
votes
2answers
34 views

Optimal implementation for effects in a card game

I am working on a card game in Unity and want to implement a system where I can create card effects that happen when certain events are triggered. The events could be anything from when a card is ...
2
votes
0answers
23 views

Making a billboard shader in Unity

I followed this guy's tutorial on making a billboard shader, and it works great, except if you are billboarding things that are tall, like a tree, it looks weird, to put it simply. When the camera's ...
1
vote
0answers
17 views

How to use animation curves to ease in out?

The script is attached to the transform that moves to target : ...
0
votes
0answers
11 views

How to create a aimLine in a pool game on unity2d?

I want to design a Aim Line for my player in unity2d. The game is split screen so what I basically want is that whenever its my player turn I want my player which is a ball to cast a raycast like you ...
1
vote
0answers
25 views

Why does Lerp not reach target if setting rb.position, but setting rb.transform.position works?

I don't understand the logic here. I have the following script which makes a player jump towards a target: ...
-1
votes
0answers
30 views

Mac unity not working (error message)

Upon opening a new project or template the unity launcher dies and shows the error message: ...
1
vote
0answers
8 views

Root Motion animation clipping through Rigidbody objects? (Unity 3D)

I am trying to program a climbing system. Player has rigidbody, ledge has rigidbody. Both also have Colliders, and the Player animator is set to use Root Motion. When Player grabs ledge and climbs up ...
1
vote
0answers
23 views

Checking if a base class type is of child class and accessing properties [closed]

I'm working on an inventory system similar to the Resident Evil games for a game jam. I wanted to practice using a little bit of inheritance, as well as ...
1
vote
1answer
47 views

Scenes do not stop showing “(is loading)”

I want to rebuild the RE4 game behaviour. In RE4, the inventory screen is a scene of its own. In Unity, the scenes which are loaded additively inherit the skybox / lights from the first scene loaded. ...
0
votes
0answers
21 views

C# / Unity : how to use in a child class a variable created in a base class? [closed]

I'm just starting to learn C# and I have a very basic problem regarding classes and inheritance. Basically, I have created a Plant class the regroups the basic functionnalities of a plant, and then I ...
1
vote
0answers
12 views

Unity XR: Get boundary world position

I'm trying to create something simular to "Everest VR"'s "Stand on the footprint" system. The way it works is the game get's the XR boundary, places a footprints texture in the ...
0
votes
0answers
21 views

Problem with rotation to normal for FPP character controller

I want to create a first person perspective character controller that allows for walking on walls and ceiling by transitioning with a slope (kinda like the anti-virus levels in Rachet & Clank: ...
1
vote
0answers
35 views

When should I start the SlowDown coroutine?

The SpeedUp coroutine is working fine as I wanted. The transform starts moving down slowly falling down a bit then start rolling on the terrain. While rolling on the terrain the player starts walking ...
0
votes
1answer
28 views

package-lock.json file for in Unity?

Since I've been asked to reformat my question, here it is : Under Unity 2020 and behond... 2020.1.12f1 to be precise. I think that my package package-lock.json is corrupted, and block the fabrication ...
0
votes
0answers
31 views

Blending between multiple textures with Unity CG Shader [closed]

I've been trying my hand at blending between 2 or more textures, so far I found I can lerp between Colors quite easily, but this lacks the detail I'm looking for. So I'm trying to blend 2 or 4 ...
1
vote
0answers
21 views

How can I clamp rotation?

...
0
votes
1answer
18 views

How do I make animation positions relative?

I have a "reload gun animation". Currently, this animation makes the character move from its current position to position (0, 0, 0). This doesn't make sense. What you could I check to make ...
0
votes
0answers
54 views

How should a Game object be used correctly? [closed]

Is it better to show game objects in a scene by using them in a script, or is it better to create them in a scane and use them in a script? (for Unity) Will there be performance differences between ...
0
votes
1answer
17 views

How can I make the objToRotate speed to rotate depending on the target moving speed?

The player has these components: Animator, Rigidbody, Capsule Collider, Third Person Character (Script), Third Person User Control (Script), and the MyLookAT script. The problem is if I drag the cube ...
0
votes
1answer
9 views

Unity equivalent of GKAgent

Does Unity have an equivalent to GKAgent in Apples GamePlayKit to define agents, goals and behaviours out of the box? Would this be the unity AI system? Or more likely a 3rd party aaset? Thanks
-1
votes
0answers
32 views

How to convert a text file (.txt) to unity format (.unity3D)? [closed]

I've tried to convert it online but couldn't find any converter.
0
votes
1answer
36 views

Two players using touch control simultaneously

I am working on a game like soccer star and I made a controller using YouTube and stuff. I added two players in the same scene and put this script on them. But when I play with player 1, then player 2 ...
0
votes
0answers
33 views

How many Sprite Atlases should be used?

I am using Sprite Atlases in my game to fix a bug with gaps between tiles as a result of oversampling, and I started wondering how the atlases should be used. What I'm asking here is whether I should ...
1
vote
0answers
46 views

How to make Enemy Wander in 2d topdown unity

I'm making a top down shooter in unity. The enemy AI travels straight to the middle before actually wandering when I put in the code. What should I do to fix that? (I'm using unity 2019.4.28f1 if that ...
2
votes
1answer
68 views

How do I guarantee that important one-time events in my UDP network protocol get received?

I'm creating an online arena game server (moba) that players can play together. 2v2 or 3v3. The game is similar to Battlerite. I chose client/server architecture with deterministic server that tells ...
2
votes
1answer
27 views

How can I stop the Unity Video Player on WebGL from starting each video with a frame of all black?

Description I'm working on a system to seamlessly reconstruct and play numerous segments of a continuous video stream by playing one segment on the active Video Player while loading the next on the ...
0
votes
1answer
21 views

Camera doesnt track player properly on different resolution

Hello i have 2d mobile game where camera follow players car, on my mobile phone with resolution 2960x1440 everything works fine but when i start the game on tablet with resolution 2160x1620 the camera ...
1
vote
2answers
19 views

Interacting with UI with a locked cursor?

It seems like Unity has disabled UI interaction while the cursor is locked, which is frustrating because the store in my game is an actual in-world one, and thus means the player has to look at the ...
0
votes
2answers
38 views

Unity Event destroys all GameObjects if there are more than two listeners

I've been writing a system where, if a raycast hits a 2D gameObject, a UnityEvent is fired and the Shot() method is executed. It ...
0
votes
0answers
27 views

Circular Z ordering problem

I am creating a day-night cycle for my 2D side scrolling game and I have a big problem. The problem can be best understood if you look at the following image: Problem is very simple: the moon should ...
1
vote
0answers
28 views

Unity XR Ray / Line renderer on the floor

When using Unity's XR system, the teleport ray / line renderer I'm stuck on the floor. Turning the XR rig also turns the line, so the line is stuck on 0,0,0 on the XR Rig I've played with most ...

1
2 3 4 5
286