New answers tagged unity
2
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 ...
1
vote
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 ...
1
vote
Unity Animation Curve to change value over time
The usual workflow with animation curves is to design them with the visual editor in the inspector. Your code can then sample the values of the curve via the ...
1
vote
Accepted
Why is my rigidbody not moving when I press the buttons? I can't see any reason it shouldn't
GameObject SDK was set to None, fixed by changing it to PhysX
1
vote
Accepted
When should an object with a collider have a rigidbody?
The advice you've found is a little oversimplified. There's an unstated assumption here:
If you have a moving object with a Collider2D and you want that movement to ...
2
votes
Accepted
Can PNG format be used for alpha channel-packing for URP shader in Unity engine?
There are two sides to this:
Can Unity correctly import and use a PNG image with channel-packed alpha?
Yes.
In the texture import settings inspector, just make sure to leave the "Alpha is ...
Top 50 recent answers are included
Related Tags
unity × 16736c# × 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