Hopefully the last one for the night...
So in the script it creates the entities with LocalToWorld components and then sets their parents, and it works and results in screenshot 1. However if I replace LocalToWorld with LocalTransform (as I believe is the proper way of going about it) the parenting and hierarchy just doesnt work and results in screenshot 2. Any help is appreciated.
#Parent not adding when localTransform added
1 messages · Page 1 of 1 (latest)
LocalToWorld is mandatory with how the transform system's parenting system works (it's just how it is), and is also needed for other things like rendering with Entities Graphics. You can use LocalTransform with LocalToWorld if you wish, and the framework will fill in LocalToWorld based on LocalTransform's value and the parent's computed LocalToWorld. There's also the PostTranformMatrix component which can be used for additional transformations that can't be expressed with LocalTransform such as non-uniform scale, so LocalTransform+PostTransformMatrix+[parent transformation] -> LocalToWorld value.
so do i have to manually add both LocalTransform and LocalToWorld?
yeah
That's pretty much what you get with TransformUsageFlags.Dynamic in a baker anyway
so that works for the hierarchy but now... the entities are invisible in the world
I don't see any initialization for the LocalToWorld of the chunk/block entities. Those need to each be initialized to Value = float4x4.identity to represent a usable default ("identity transformation").
like that?
yes
still invisible ;(
try inspecting LocalToWorld values down the line, see if anything is all-0
Make sure you also do that for the block entities
i figured it out
silly me
scale on all those localtransforms was 0
thank you though
i guess all thats left if you have any idea
at the bottomish of the script you can see it does some basic euler rotations and applies it to the localtransform
yet... the rotations look all wonky like this
DOTS stuff (specifically starting with Unity Mathematics) is in radians, either convert with math.radians(90f) or do 0.5f * math.PI