Skip to main content

New answers tagged

2 votes
Accepted

Applying localScale to elements in a verticalLayoutGroup with a gridLayout subgroup

Set the pivot X of DecLineUISetup to 0, so that the object is scaled from its left edge instead of its center.
Kevin's user avatar
  • 7,019
2 votes
Accepted

How to program era-switching in an endless runner?

A simple way you could approach this is to make each prefab contain both "versions" of itself: era 1 and era 2 as separate child objects - one enabled, one disabled. When changing eras, tell ...
DMGregory's user avatar
  • 141k
0 votes

AI Algorithm to make enemy smarter from level to level in Runner game

In games where AI-controlled units are chasing or racing against the player, there's a very easy way to adjust difficulty over time without having to worry about finding different AI algorithms or ...
Kevin's user avatar
  • 7,019
2 votes

Unity HDRP custom pass stencil buffer not working in build mode

I figured it out for anyone who stumbles across this post: In my mask buffer allocation, I have to add a depth buffer size, like so: ...
Critical Angle Studios's user avatar
0 votes

Draw calls within SRP Batch

If your map has hundreds or thousands of hexes, I would not recommend trying to render all of them in the mini-map; whether or not they can be batched, this is adding too much complexity/overhead to ...
Kevin's user avatar
  • 7,019
0 votes

Sign out of Google Play Services through code

PlayServices no longer require a sign-out button (link), hence the deprecation. It seems their direction for v2 is to alternate between accounts, using a default account always signed in. Also the ...
NPatch's user avatar
  • 101
0 votes

Is there a "best practice" for making changes to packages

Even if you manage to automate the diff transfer (I have a mind to try out Roslyn SyntaxTree and code injection at some point for this), the reality is that the rest of the code can still change, as ...
NPatch's user avatar
  • 101
2 votes

Is it worthwhile to use events when there’s only one subscriber?

I've found this is more or less the entire point of design principles. When you learn design principles in schools or otherwise serious courses, you get taught to always use them no matter what. This ...
Themoonisacheese's user avatar
10 votes

Is it worthwhile to use events when there’s only one subscriber?

This question is on the border of "primarily opinion-based". There are no right or wrong solutions to software architecture problems. Only solutions that work for you or solutions that don't ...
Philipp's user avatar
  • 123k
3 votes

Animation can't disable gameobject

Final frame sampling in Unity is not guaranteed and this has been an issue for a very long time, move your de-activation earlier or don't use it in the animation editor at all. This is due to the ...
Windex's user avatar
  • 56
15 votes
Accepted

Destroying the parent when all children are destroyed

After searching for a better way, I came across OnTransformChildrenChanged: The following changes to direct children of a GameObject invoke ...
Zibelas's user avatar
  • 5,089
0 votes

How to make TextMeshProUGUI truncate the left part (beginning) of a line?

I needed to truncate the beginning of a text and display ellipsis, starting from the end and discarding the first words of the text. For instance, ...
Curio's user avatar
  • 261
0 votes

How can I get Unity to do letterbox/pillarbox to maintain aspect ratio?

I tried @Almo solution but actually it didn't work in all the cases: It was ok with aspect ratio 2:1 It was ok with aspect ratio 4:1 It was not ok with aspect ratio 1:2. As you can see below, the ...
Curio's user avatar
  • 261

Top 50 recent answers are included