New answers tagged unity
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.
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 ...
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 ...
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:
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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, ...
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 ...
Top 50 recent answers are included
Related Tags
unity × 16744c# × 5730
2d × 1156
shaders × 708
physics × 698
animation × 667
collision-detection × 532
android × 475
camera × 471
rotation × 471
gui × 431
3d × 417
movement × 351
sprites × 344
textures × 309
optimization × 297
unityscript × 294
rigidbody × 264
lighting × 253
mathematics × 250
raycasting × 238
input × 235
blender × 235
rendering × 233
unity-ui × 210