Default Scale is Zero -- Lint for footguns? #5754
Replies: 2 comments 3 replies
-
Not related to the linting portion of this, but it's probably recommended to use |
Beta Was this translation helpful? Give feedback.
-
There is a unofficial crate for bevy linting: https://github.com/MinerSebas/bevy_lint, but linting at this point of Bevy is very tough work, since API will be changed a lot. When we got the Bevy Editor I think this kind o problem will be easier to track down, since one could just inspect why the mesh/sprite/UI isn't being rendered. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was having problems with the following code:
I thought at first that the player was being drawn past the camera FAR, but this turned out not to be the case. No matter what I did with the Z-depth, I couldn't make the character appear. This, however, worked fine.
Ultimately, it turns out that the problem was nothing to do with the transform and everything to do with the default scale, which is 0,0,0, making the sprite invisible.
Since scale is a Vec3 I don't think we can change the 'default' for just that type, but perhaps there can be a lint or a debug-only message which helps people who spawn something with a default scale of all zeros?
Beta Was this translation helpful? Give feedback.
All reactions