New answers tagged unity
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 ...
1
vote
How do big open worlds handle Object Pooling?
What you need to consider is which objects in your game only differ by data and which differ by components.
For example, when you have a lot of projectiles in your game which only differ by speed, ...
3
votes
How do big open worlds handle Object Pooling?
One important consideration to add is that most open world games are not built in a managed language like the C# used in Unity.
In a managed language with an automatic garbage collector, creating and ...
2
votes
What’s the correct / idiomatic way to pause a game in Unity?
I usually use the system you described first - set Time.timeScale to 0 and provide an easily accessible bool to check if the game is paused.
Note that this can get ...
0
votes
How do big open worlds handle Object Pooling?
many different weapons with many different bullets. Do you have to create one pool for each? Maybe not for all bullets. A small handgun and a weapon that shoots faster will probably have almost the ...
1
vote
Can't get a Prefab to scale down accordingly inside a Container
Using a simple card prefab, adding only the Aspect Ration Fitter to it
and having a container with the horizontal layout group (added an image for better seeing the container)
and a simple button ...
Top 50 recent answers are included
Related Tags
unity × 16738c# × 5728
2d × 1156
shaders × 708
physics × 698
animation × 667
collision-detection × 532
android × 475
camera × 471
rotation × 471
gui × 431
3d × 417
movement × 351
sprites × 343
textures × 309
optimization × 297
unityscript × 294
rigidbody × 264
lighting × 253
mathematics × 250
raycasting × 238
input × 235
blender × 235
rendering × 233
unity-ui × 210