Hot answers tagged

1

It's spelled Rigidbody2D, not RigidBody2D. Capitalization matters in C#.


1

I have found the answer here. Although it is not completely explained mathematically in my opinion, it works well. The code I use is like this: private void Start() { // ... PositionCamera(); } /// <summary> /// Source: https://forum.unity.com/threads/dynamic-loaded-object-fit-to-screen-size.349794/ /// </summary> void PositionCamera()...


1

What I’m describing was caused by the Rigidbody2D auto-calculate mass. Just uncheck that box and it should work fine!


1

As this question is kinda 2 questions in one, I'm going to answer the one that I think is the root of your problem (scale sphere relative to plane). Because if I read this correctly, the pixel part sounds like you only want to do that because you couldn't find the solution to your original problem. In Unity, a position is based on 'units'. a 'unit' doesn't ...


1

When the canvas is set to screen space overlay, the z isn't going to do anything as 'Screen space overlay' uses an orthographic camera which renders everything between z -1000 and z 1000 the same. It is not going to look like it is closer to the camera. That is just how an orthographic projection works.. I think you'd either want to set it to Screen space ...


Only top voted, non community-wiki answers of a minimum length are eligible