Skip to content

Can not move bone or a node #2390

Answered by xyz99002
xyz99002 asked this question in Newcomers
Jul 15, 2024 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

I have my code working now after changing like as below. It was not working because Transform is a structure and hence copying it to zTransform was copying the data and updating was updatig the copy. In Unity it is a class so it works. To make it work in Stride, I keep reference to the array which is assigned by reference. Directly changing the stricture using that reference resulted in the node/bone moving.

Thank you for your support.

public Entity robot;

private Vector3 zPosition;

ModelNodeTransformation [] transforms;
int zTransformIndex;

public override void Start()
{
    var test = robot.Get<ModelComponent>().Skeleton;

    for (int i = 0; i < test.Nodes.Length; i++)
    {
       …

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@xyz99002
Comment options

Comment options

You must be logged in to vote
4 replies
@IXLLEGACYIXL
Comment options

@xyz99002
Comment options

@IXLLEGACYIXL
Comment options

@xyz99002
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by xyz99002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants