#3D card game - Question about units

1 messages · Page 1 of 1 (latest)

mystic plover
#

As far as I know 1 unit = 1 meter in unity.

I also heard it is generally recommended to abide by this rule.

I'm making a card game where I have layered cards. I achieve this by adding a TMP_Text component(for example) about 0.001 units away from the card/previous layer.

If I scale the cards as 1x1.4 (as in, huge ass cards) it looks right. I'm worried a bit about converting this to real dimensions (0.01x0.014) as it is tiny and I'll have to equally shorten the spacing of my layers.

Is this even at all important? I heard its recommended to keep units real for rendering purposes - especially in 3D software like blender to keep the rendering right.

I have actual real size characters playing cards. So if the cards are a 1 meter by 1.4 - the characters are massive...

heady ginkgo
#

As far as I know 1 unit = 1 meter in unity.
Well, yes... but also no

mystic plover
#

wdym?

heady ginkgo
#

Unity by default assumes units to be metres (after all, Physics.gravity defaults to -9.8 which is the Earth's average rate of acceleration of gravity in metres/second). But that doesn't mean to say it absolutely equals metres at all times.

Like, you could change things so that 1 unit = 1 foot. And instead of a human being 1.8-2 units (metres) tall, it could be ~6 units tall (i.e. 6 ft).
You could then change Physics.gravity to -32.2, which is the equivalent value in feet/second. And then change the Rigidbodies so that mass is inferred to be in pounds, rathern than kg.

As long as you are consistent with your units, none of it breaks

mystic plover
#

hmm yeah that's what I thought. But there are things rendering related that seem set up for smaller units

#

like DOF

#

I guess that worst case I can create my own DOF or something >_<

heady ginkgo
#

It should be fine again as long as you're consistent. It's all consistent by default using the metric system. Units are implied to be metres, rigidbody masses are in kgs, AddForce assumes Newtons etc.

#

I heard its recommended to keep units real for rendering purposes
So yeah, I guess you're right. To make things easier, you should just stick with the units that Unity assumes them to be. It's not impossible to do otherwise, it's just a lot of work

#

(and you'd probably have to do your own DOF and shaders and stuff otherwise too, like you said)

mystic plover
#

aww Shikes... Thanks for the answer though! 🙂

#

I do hope that I can keep my layering. Things seem to start glitching on low numbers like that

heady ginkgo
#

Makes sense. Sounds like a classic case of z-fighting

#

From what you describe anyway

mystic plover
#

Yeah definitely. Maybe I could generate card textures in loadtime with a different camera and massive cards and then put that on small quads

heady ginkgo
#

Hm that might work actually

#

Yeah try that LUL gg

lost summit
# mystic plover Yeah definitely. Maybe I could generate card textures in loadtime with a differe...

With custom shaders you could use the Offset command to avoid z-fighting. By using unrealistically scaled objects you may face issues not being able to increase or decrease some values enough what comes to shadow biases etc (maybe you still could extend the range of possible values via script). On the other hand on games like KSP or micro scale games, you just cant work with real life scale, as yasa said you just need to be consistent with the units, real life scale just works very well on most cases