0
$\begingroup$

I have two objects: the "track object," and the "follow object." The track object rotates according to the mouse (mouse-look). When the track object rotates, I would like the follow object rotate too (follow the track object; rotate till it matches the track object's rotation). I'm also looking to have this work with time, very similarly to the "track to" option in the "edit object" actuator: it does not immediately follow the track object by simply copying its rotation, but it takes x time to follow up (copy). By introducing time, the object takes time to follow up, which means that there is a possibility of the follow object's rotation to be way off (as the track object has moved a lot, and the follow object does not change instantly). To compensate, I am looking to have a cap. The follow object must be in a range. The range is the rotation. It will range from (the track object's rotation minus 10) to (the track object's rotation plus 10). This way, the follow object will never be far off the track object's rotation as it is kept in a range. A final note: I am looking to have this work in only the x and y axis. I would like an answer in python. Any help is appreciated. Thanks!

$\endgroup$
1
$\begingroup$

What you are looking for is the transformation constraint combined with a limit location constraint.

Example animation

In this example I am using the rotation of the z-axis to move the location of the x-axis. The mapping in the centre links the source z-axis to the destinations x-axis. The source and destination amounts provide a way to scale the transformation, when the source is at 0 degrees the destination will be at 0 and when the source is at 180 degrees the destination will be at 5, so 180 degrees rotation moves 5 units. If you change the destination location to 0 and 40 then the 180 degrees rotation will give 40 units of movement.

I then added a limit location so that the object will only move from -4 to 4 on the x-axis.

Sample constraints panel

$\endgroup$
  • $\begingroup$ Thanks for the answer, but I think you misunderstood the question, or I haven't explained it to the best of my abilities. Sorry for the inconvenience. I've completely rewritten the question to clarify. If there's anything unclear, you can ask me. Thanks. $\endgroup$ – blackhole Feb 16 '16 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.