Moving along path controlled by switchboard

Hello everyone!

I’m pretty new here (it’s my first thread) and I haven’t found what I’m looking for :(, that’s what brings me here.

I’ve created a vehicle and I want to animate a cover along a path. No worries so far.
But I’ve set up a switchboard (or maybe it called otherwise) to control some part of that vehicle and I don’t know to link the switch to the path so the cover move accordingly.


Does anybody know how to do that?

Thanks!

Welcome to BA - I have only just seen your post.

Use a Driver,

  1. Check “Autorun Python Scripts” in User Prefs => File Tab.

  2. RMB Click the Offset box in the Follow Path constraint (I am assuming that is how you did it…)

  3. Go to Graph Editor and select Driver Mode.

  4. Set the Target object as the “Slider” and what ever axis movement you have decided on (Looks like Z to me from your image). Set Transform Channel.

  5. Set the expression to “Scripted Expression” and then enter the expression. So if the slider moves from Z = 0 to Z = 5 and the offset moves from 0 to 1 the scripted expression will be var / 5 ​if you have used var as the variable.

Cheers, Clock. :slight_smile:

PS. Scripted expressions DO NOT WORK unless you set the checkbox in User Prefs and save.

Here is a typical driver setup:


Your scripted expression will be a little simpler…

I’m sorry, I’ve just see your answer…:eek:

Thanks a lot, it works perfectly!

You’re welcome!

Cheers, Clock.