Notifications
Clear all

[Closed] local transform position through scripting

I am trying to use a joystick to move an object along it’s local axis. I have two dummies, one being the target and the other one looking at it. I can’t figure out how to tap into this through expressions.

I have another dummy responding to the joystick, and i thought it would be simple to construct a new vector based on the joystick input and rotation of the main object, but i can’t figure it out.

Is there an example somewhere or a tutorial that covers this particular subject?

2 Replies

Have you looked into the motioncapture controller and utility? They are made for this sort of task. You can simply add the motioncapture controller to the x-axis of the object and assign it to the joystick. No scripting neccessary.

you could try turning this into an expression, it will move the object along its local. you just need to pass a point3 with the input from the joystick. Never used a joystick before in max though but if you can put sensible values into the point3 it should work.

obj1 = $box001
 inputPos = [0,1,0]
 
 in coordsys Local obj1.pos += inputPos