Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Local offset of spring controller

Local offset of spring controller

giuseppetonello
Advocate Advocate
370 Views
1 Reply
Message 1 of 2

Local offset of spring controller

giuseppetonello
Advocate
Advocate

I'm trying to get the local offset values of the cross helper you see in the attached image.

The helper has a spring controller and is linked to the box.

The box and the sphere are linked to the object called bound, which is animated along the x axis, so that you can see the spring animation in action.

 

$Spring.controller.position.x gives me the world coordinates, which I don't need.

Instead I would like to get that 22.016 number, which displays correctly in the parent space, as you see in the second image.

 

As an extra, once I get that value  (how much the spring offsets from the box) I need to plug it in a float script to drive the box y rotation, via a float script.

 

Joey
0 Likes
371 Views
1 Reply
Reply (1)
Message 2 of 2

giuseppetonello
Advocate
Advocate

Ok, I've found the solution myself.

This line of code did the trick (inside the y rotation controller).

 

$Spring.transform.pos * inverse $bound.transform

Joey