Move bones/ model nodes


#1

Hello, I’m actually trying to move a bone in a model ( the example model)
so here’s how i do it

 //getting the modelcomponent 
var modelComponent = Entity.Get<ModelComponent>();
//Finding hand component and applying rotation
for (int nodeIndex = 0; nodeIndex < modelComponent.Model.Skeleton.Nodes.Length; nodeIndex++)
            {
                var nodeName = modelComponent.Skeleton.Nodes[nodeIndex].Name;

                if (nodeName.Contains("Hand"))
                {
                    modelComponent.Skeleton.NodeTransformations[nodeIndex].Transform.Rotation *= Quaternion.RotationX(4.0f);
                }
            }

It actually doesn’t work, the issues that i think happen is probably the fact that the nodes are structs and structs modifications are not kept.