I can set translation`value but entity can`t move ?

hello friends, I am doing a project which is called dynamicHairs, now i can get new position and quaternion for one bone ,just like the picture, the bone cant move and the transforms value is not change. anyone have good ideals? thank you!

I believe the Translation/Rotation components are only used to set the initial values of the Entity’s transformation; after being converted to ECS components at startup, I don’t think they’re referred to again. This is an older version of the Entities package than I’m used to though. Can you tweak the position/rotation/scale in the Transform component directly & see results in play mode? If anything’s kept in sync with the ECS data, it would be that.

I made it in imitation of other people’s Demo【version.17】.but now i used version.30, so i have to try used localToWorld compondent,is it right? (i just want to set Rotation and Position,and let the obj moved) ,do you have any good ideal?

Also, TranslationProxy is deprecated (because of new workflow). You’ll need to manipulate Translation and Rotation in code (or modify LocalToWorld directly).

namespace Unity.Transforms
{
    [UnityEngine.DisallowMultipleComponent]
    [UnityEngine.AddComponentMenu("DOTS/Deprecated/Translation-Deprecated")]
    public class TranslationProxy : ComponentDataProxy<Translation>
    {
    }
}

thank you ,i will have to try by using LocaToWorld ,i want to set Translate/Rotation it means that the entity also need a compondent (CopyTransformToGameobjec) ?

Yes for the hybrid workflow you can use CopyTransformToGameObject so that translation, rotation, and scale (held in LocalToWorld matrix) will get automatically copied to the GameObject’s transform.

Added to that, when dealing with transformation in code, you can’t directly modify LocalToWorld if there is any other transform component on Entity, such as translation.
https://docs.unity3d.com/Packages/com.unity.entities@0.0/manual/transform_system.html

1 Like

Hello, I want ask you a question that how can i get transform.rotation from the component LocalToWorld,i had added the component CopyTransformFromGameobject to the gameobjec; thank you very much.

thank you for your help, but I want to ask you another question that how can i get transform.rotation from the component LocalToWorld,i had added the component CopyTransformFromGameobject to the gameobjec;

You can do this:

var rotation = new quaternion(localToWorld.Value);

I am learning Tranforms ,In the Section 2: Hierarchical Transforms (Basic) ,I find two components LocalToParent and Parent,and i also find Child, so if i want make a chain ,I control the first warp motion, and the later nodes move again according to their parent trajectories:
1: I cant add LocalToParent to the gameObject,so i cant get the translate and rotation(in parent space),Is there any other way to do it?
2: In the ECS, how to get the info of parent transforms and child transform from one entity(gameObject);

I have a feeling that you need to look into the conversion workflow. The easiest way to observe how hierarchical transforms work in ECS is to snap a ConvertToEntity script on a GameObject with some children, and then see how everything gets converted in playmode. Ofc, digging into the actual source code also helps.

hello! I have a problem that i want to get an entity`s sacle from localToWorld? how can i do?(i had added two component in the entity [LocalToWorld] and [CopyTransformFromGameObject])