Animated button

I have this lever and when press I want it to play an animation so that it moves down or however levers move… I have found 2 threads on this but none of them really explain this well enough. I have a nodraw box (Func_button) over the lever (Prop_dynamic). How do I proceed to animate it?

func_rot_button or whatever its called? I’ve never tried it so I wouldn’t know.

From what I’ve heard you make the lever a prop_dynamic and get it to play some animation… I’m just fuzzy on the animation part.

Name the prop_dynamic something like “lever”. Check in the “model” tab of your prop_dynamic if the model has a sequence that makes the lever go down. Now copy the name of that sequence. Go to your func_button and go to outputs. Make a new output and do this: My ouput named: OnPressed, Target entities named: lever, Via this input: SetAnimation, with a parameter override of: [name of sequence goes here].

Thanks it worked. Except for the fact that the lever slides off the table and floats in mid-air. Oh Hammer, why do you make life so difficult?

Have you checked the “Don’t move” flag in your func_button?

You should. (this may be causing it if the lever is parented to the button)

Thank you very much.