Notifications
Clear all

[Closed] Animate object A to match object B

Hi all,
Im new in Maxscript but I have some knowledges in other programming language. So I feel really strange about this situation:
I have two boxes in the scene. I then write a simple script to animate the Box001 to move to Box002 position, scale it to the same size as Box002 and rotate to match its rotation so that the two boxes will match. But the problem is Box001 never go to the same position and never match the size.Here is my code:
with animate on
(
at time 0
at time 50 $Box001.position=$Box002.position
at time 50 $Box001.scale=$Box002.scale
at time 50 $Box001.rotation=$Box002.rotation
)
Can someone explain it to me

3 Replies

If you set position after rotation it should work. I’m not entirely sure why setting the rotation value moves the object other than saying rotations in 3d apps are very complex.

You can also just set $Box001.transform = $Box002.transform. That will set all three properties.

But the problem is Box001 never go to the same position and never match the size.
ResetXform both boxes, then execute the script.

Thank you guys for your responses. I will try your suggestion.