ScriptSpot

Forum topic · General Scripting

Moving objects on single axis

By JokerMartini · 2010-07-19

Description

How do I axis an individual axis on the position of an object. For instance I wanted to move an object on the X-axis without using the point 3 value.
Is there any simple action I can write using maxscript like
$Sphere01.position.x_position = 10

so it movies it on the x axis to unit 10.
It is such a simple thing but I'm not having any luck finding it in the help file for maxscript.
Thanks
JokerMartini

Comments (1)

real08121985 · 2010-07-21

Use the .pos-property, it's a point3-value. You can access the .x, .y and .z property of point3-value.


([1,2,3]).x -- access the x-property of a point3-value
$.pos.x += 10 -- move the selection 10 units on x-axis