Transform Issues

I updated from 1.0.0 pre.12 to 1.0.0 pre 15.

So, the transform requires update. However, I encounter an issue.

ECBSystem.SetComponent(chunkIndex, enemy, new WorldTransform{Position = new float3(45, 1, 45)});

For the above code, using worldtransform, the enemy appears at 1,1,1, roughly there, not the 45, 1, 45 position.

ECBSystem.SetComponent(chunkIndex, enemy, new LocalTransform{Position = new float3(45, 1, 45)});

If I put Local Transform, then NAN.

Please see first picture. All positions, including LTW and rotations are NAN.

If we put both WorldTransform and Local Transform, whichever order will result in error also.

See second picture.

Except for rotation and scale, all positions are NAN.

Am I missing something?

Btw, I don’t see how this new Transform system is better.

For the player to initiate a bullet, in pre 12 version, I just set translation = transform.position, rotation = transform.rotation, the bullet can be instantiated in front of the player.

Now, I have to do two things still:

Set WorldTransform.Position to player’s transform position, scale at 1
Set local transform.rotation to player’s rotation.

Yes, needs to set both world and local transform to achieve the same effect although I am setting a bullet without any child object!!!

8667471--1167324--Untitled.png
8667471--1167327--2.png

You were always doing this wrong.
-Both WorldTransform and LocalTransform should be present.
-Only LocalTransform should be written to.
-ITransformData should always have a valid scale and a valid rotation quaternion.

https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/transforms-using.html

Thank you very much! Love!

Btw, then is this a bug?

ECBSystem.SetComponent(chunkIndex+1, e, new LocalTransform {_Position = new float3(45, 1, 45), _Rotation = playerAttack.GetRotation, _Scale = 1f});

In this way, the launch position is not the one I set. It is still (0, 0, 0).

ECBSystem.SetComponent(chunkIndex+1, e, new LocalTransform {_Position = new float3(45, 1, 45), _Rotation = playerAttack.GetRotation, _Scale = 1f});
ECBSystem.SetComponent(chunkIndex+1, e, new WorldTransform {Position = new float3(45, 1, 45)});

If I set worldtransform also, the launch position is (45, 1, 45).