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

Compute thrust applied to ship's sails depending on sailSize, sailState and relative angle of wind

I'm trying to calculate the speed of a ship, depending on many factors. the speed of the wind the relative angle between the sails forward and the wind forward. transformed into ...
0 votes
1 answer
11 views

Use one collider for Rigidbody2D.Cast, and another for a hurtbox

I'd like to do the following: Characters (player, enemies) have a collider for collision with the world (= other characters/obstacles/etc) Characters have another collider acting as a hurtbox (most ...
0 votes
1 answer
15 views

Sprite Shape & URP Custom 2D Lighting Shader

I've been losing my mind over this for a couple of days now, and can't find any concrete information about it. I am trying to write a custom shader (shader graph to be specific) to light sprite shape ...
0 votes
1 answer
21 views

Clip a 2D sprite within a bounding box without masking

In Unity, working on a 2D game, I have a platform game where the platforms can "sink" when jumped on. The platforms are 32x32 sprites, and when sinking, the desired effect is to push the ...
  • 101
0 votes
1 answer
29 views

Get component of velocity parallel to a normal

I would like to transform a rigidbody's world velocity into a local velocity based on a normal direction. When the rigidbody is moving towards and within a range of a object, I use a raycast to ...
0 votes
1 answer
29 views

LookRotation/object roll issue in Unity

I was hoping to get some help with a LookRotation() issue I've been having in Unity/C#. In my project I have a target that attaches to the camera when clicked on (...
0 votes
1 answer
9 views

Change the "Font Asset" of every TextMeshPro object

I have a large project in Unity and I would like to change the font for every TextMeshPro Object in every scene. I've tried changing the "Default Font Asset" in Edit > TextMesh Pro > ...
1 vote
0 answers
21 views

How to record inputs and play them back for a demo?

I was curious how I can implement a good system for recording inputs to make Quake/Doom style demos in Unity. I'm relatively new to game dev so figured I'd ask some people with actual experience.
3 votes
1 answer
48 views

Implementing a pinball flipper without tunnelling

I'm trying to create a pinball and flipper system in Unity. Unity has documentation specifically on a spinning body and a ball. I am using rigid bodies for both the ball and flipper. I've set the ball ...
  • 131
2 votes
0 answers
28 views

Profiling Loading and Unloading of Addressables

I've recently set up a small helper class to load and unload addressables, it contains the following methods for that purpose ...
0 votes
1 answer
29 views

Get connected GameObject information in unity C#

I am working on a project where I want to know which nodes are connected with the connection Hub. Like the picture below: These nodes are the game objects and I want to know their connection status ...
0 votes
1 answer
20 views

Mirror a 3d position vector3 based on a vector3 and rotation

I have a point in 3d space and a coordinate with angle (a imaginary plane) Here's my input data : A ) a vector3 which defines a position in world space B ) a vector3 which defines a mirror position C )...
  • 17
0 votes
0 answers
40 views

Adding Velocity To Movement In A Parabolic Arc

Good Evening All, I am moving my projectiles in a parabolic arc using the following code: (Credit to Joe Strout for the formula! https://luminaryapps.com/blog/arcing-projectiles-in-unity/) ...
0 votes
0 answers
21 views

Google Test ads appear on the phone, but the actual ads are not visible. Why could it be?

When the player object collides with another object, it disappears and the "game over" menu is opened and the score is displayed. Just then, the "interstitials" advertisement ...
  • 13
0 votes
0 answers
19 views

Problems with animations of UI [closed]

Here is the situation: I got 4 animations of UI element: idle which is running all the time, action animation and 2 other clips which is actually go away from screen back to screen. So after the ...
  • 1
0 votes
1 answer
72 views

Deal damage just once, rather than repeatedly till the enemy dies

I am new to making games with Unity. I am trying to damage the enemy. So far, the damage works. The problem is it will repeat it until the enemy is dead, but I want it to damage the enemy only once. <...
0 votes
1 answer
15 views

Create token in Unity to send post request to Laravel controller

Some time ago I wanted to be able to create a token in Unity and send it to a Laravel Controller for saving logins and user game data to an account. I eventually got this working so I am sharing my ...
0 votes
0 answers
25 views

Procedural Generation of City Environment for Endless Runner [closed]

For a university project, I'm currently coding a game similar to Subway Surfers and Temple Run. As part of our assignment, we need to implement procedural generation of some aspect of the game. For my ...
0 votes
1 answer
27 views

How to know what is included in a Unity Asset Store asset

I'm very new to Unity and game development in general. I'd like to re-create the birch forest demo video shown here. I presume this isn't a scene that comes with your purchase, but just "what you ...
1 vote
0 answers
20 views

Unity fading alpha of TMPro text causes noticeable frame rate drop

I am using this code to change the transparency of my TMPro TMPUGUI text when changing a page (from a book). ...
  • 111
0 votes
1 answer
26 views

Instantiate only specific objects in Unity

Here is the situation: I have 10 weapons in my game, in main menu player may choose only two weapons that could take to the game, and this information about two weapons will save in a kind of "...
  • 1
0 votes
1 answer
20 views

Smoothing transition between Animator and script controlled character

I have a NPC which has a strict match logic (bot player), and I am moving it on FixedUpdate(), However, on certain events in the game I am activating animations ...
0 votes
0 answers
25 views

My player moves back after I stop any user input in Unity

In the first scene(grass scene), the player works fine in the grass scene, but inside the house, the player after any input the player moves back a bit. https://i.imgur.com/aHXwCR7.mp4 My player ...
0 votes
0 answers
10 views

Shader UV Normals/Direction vs UV Tiling/Stretching for Sprite Shape

I'll be the first to admit I'm not fantastic with shaders, so as far as I know, this may be a very simple solution that I'm just unaware of. What I'm trying to do is to write a shader for Unity's ...
0 votes
0 answers
14 views

Workflow For Manually Creating .DDS MipMaps For Unity?

I am hoping to gain some clarity on the proper way to create .DDS format mipmaps for Unity. I was able to create the file and successfully import it into Unity, but I am certain my workflow is far ...
0 votes
1 answer
13 views

Collider overlap is not being detected

I am writing some logic to handle spawning objects into a game scene at a randomly generated location based on the size of a collider's bounds. The logic for getting the coordinates and instantiating ...
  • 237
0 votes
0 answers
22 views

AudioSource.isPlaying is not working in Unity WebGL Build

I am passing a clip to play on the audio source. Next, I wait for the audio to finish to invoke the next action. But the waiting loop never ends. Once the audio clip ends, the time I read from ...
-1 votes
1 answer
108 views

Why process physics before the variable framerate update in a game loop?

As far as I know, most game loops are executed in the following order: Process user input Update (once per frame) Physics (also known as fixedUpdate, 0 to N times ...
1 vote
1 answer
42 views

How to make a shader which alpha blends against only itself, and is opaque otherwise?

Imagine a scene with a minecraft style world held in a bounded container and is being viewed from a isometric 3rd person camera that has a fixed orientation. I want to create a shader that expresses ...
  • 113
0 votes
1 answer
27 views

Increasing Recoil Over Time With 'Diminishing Returns'

I have a recoil system where per shot, the recoil value increases. I want the recoil to increase more quickly for the first 10 or so shots, then settle to a slower increase rate that then remains ...
  • 1
0 votes
1 answer
27 views

Navmesh agents trying to go to destroyed objects

I am still working on the RTS and have added a system that allows enemies to randomly wander. However, when multiple enemies fight one of my units, they will just clump up Afterwords instead of going ...
0 votes
1 answer
16 views

How do I calculate the direction of an object relative to the another object's view

Here is a diagram of what I'm looking for: I am trying to find the math solution to determine where that smaller circle is relative to the bigger circle's view. I thought that the easiest way would ...
  • 3
0 votes
0 answers
20 views

Find points on circumference similar to an orbit entry point for a spacecraft [duplicate]

I'm trying to find the point coordinates on the edge of a circle like this: I know: The coordinates of Point A The coordinates of the centre of the circle (Point B) The radius of the circle I've ...
  • 101
0 votes
1 answer
26 views

How to emulate the look of loading ZX Spectrum title screens in Unity

I am looking to replicate the style of screen loading as seen on the ZX Spectrum in Unity. Not the stripes of colors in the background. Just the title image loading. Specifically the way it looks in ...
0 votes
0 answers
31 views

Trigger Custom Event node in Unity Visual Scripting causing ArgumentOutOfRangeException error

I am using a Trigger Custom Events node in Unity Visual Scripting. It usually works but around 5% of the time... I get an error that says: << ArgumentOutOfRangeException: Index was out of range....
  • 227
1 vote
1 answer
74 views

How To Calculate The Correct Sprite Dimensions?

I am creating a 2.5D game similar to Paper Mario. I want the sprites that I import to Unity to be the perfect dimensions so that quality is not affected by the camera's position. If I'm understanding ...
0 votes
0 answers
40 views

Unity - Models suddenly stuck in poses In-Editor and 3D Animations messed up across project

Please Note: I'm having trouble placing pictures here, but I have a thread on the Unity Forums of this issue with images and additional video. Please refer: https://forum.unity.com/threads/models-...
  • 179
0 votes
1 answer
47 views

How to reconnect a client to a match (not the server)

In a multiplayer client-server Unity project using Mirror networking, I have a matchmaking system where the server matches two players and gives them a MatchID. The ...
0 votes
1 answer
25 views

Does Raycast called from Update execute on next FixedUpdate?

I've been searching through the Unity docs (https://docs.unity3d.com/ScriptReference/Physics.Raycast.html), but no matter where I look, I couldn't find exact behaviour of Physics.Raycast() method. I'...
0 votes
1 answer
23 views

How to read Unity Ads initialization code structure? [closed]

It is my first time integrating Unity ads into my game and my first time encountering the sample code below with the usage of "?" and ":" and wanted to ask how to read the line of ...
0 votes
1 answer
63 views

Sprite becomes blurry or jagged when camera zooms out

My game uses 2D sprites in a 3D environment, and I'm really struggling with my sprites' quality. I have high resolution vector art with clean linework created for my sprite. I'm exporting it as a .PNG ...
2 votes
0 answers
69 views

What is meant by Blender's "Minimum" twist method/how do I correctly calculate bezier curve twists?

I'm working on a bezier curve implementation in Unity. Until recently, I had no need for roll (the objects that followed the curve always stood upright) but I've since added a roll value to each ...
0 votes
2 answers
73 views

Determine which cannons on a ship can hit a target [closed]

I have a ship that will shoot targets, but cannons on the right side should never try to shot at targets on the left side of the ship. Thus I have created sectors using the ...
0 votes
0 answers
40 views

Circle color rotate minigame match problem

I am creating a minigame that involves rotating colored circles so that the colors match relative to the central circle which is fixed. I was thinking of checking with colliders that the two points at ...
  • 1
0 votes
2 answers
51 views

How can I make the hue of a material change over time?

I'm working on a small psychedelic-style game that needs to be done in Unity, with which I have no prior experience. I'd like to achieve an effect where the material of my objects can change colors ...
0 votes
1 answer
41 views

How to show orientation on an image minimap in Unity

Initial Question: I'm trying to create a minimap for my game in Unity. It consists of a 2D image sprite within a mask. I've got the rotation and the movement within the mask down, but the only problem ...
  • 1
0 votes
0 answers
35 views

Unity top down character movement animation goes sideways

I am struggling with the animation handling for my top down character movement. The game is a 3D top down game. The character is always facing in the same direction as the pointer and I have ...
1 vote
1 answer
64 views

How do I determine if a given grid coordinate is fully within a triangle?

I'm using Unity's Grid system, and I'm drawing triangles on the grid. Each triangle is recorded as a Vector2Int origin point and a ...
0 votes
1 answer
37 views

Setting target framerate changes animation speed in editor, while Time.deltaTime stays the same

I have few animations that work similar to this: ...
0 votes
0 answers
39 views

Rounded Line Shader

I am trying to achieve a rounded Line where Line will go through point A to point B with GLSL. I am able to do it on Shader Graph however I don't want to create my project while using Universal Render ...
  • 3

1
2 3 4 5
308