Swinging object?

  • If you're asking a question make sure to set the thread type to be a question!

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
So this might be a pretty simple question, but having no experience outside of TF2 mapping, I am unfamiliar with the physics systems. Perhaps there is a better option besides that though.

What I'm trying to do is put a crane claw, "holding" a barrel, lightly swinging back and forth in a detail area. Not a huge movement, just a gentle back and forth swing, like it's still coming to rest.

It would be pivoting from the top of it, and only doing a small back and forth swing, with a barrel parented to it.

What is my best course of action to get this effect?
 

re1wind

aa
Aug 12, 2009
644
588
phys_lengthconstraint, nodraw func_physbox, and parenting a prop_dynamic to the physbox. You need a rope (move_rope, keyframe_rope) to act as the visual cable.

That will give you the physics based hanging detail, but it will quickly settle into an idle position.

-------------edit------------------

actually, if you make a func_door with a small speed and appropriate move direction, etc, you can easily get the horizontal movement you need. much simpler and easier than actual physics, and the actual pendulum movement of the real thing is almost linear so it will be hard to notice.

:)
 
Oct 6, 2008
1,947
445
Ya - I remember that func_pendulum from an early version of hammer too - I think it was in the half life or cs mode set up.

Would it be possible to get it from there and then import it into TF2? You might had to mod it though?
 

re1wind

aa
Aug 12, 2009
644
588
func_door_rotating, set its origin up by the top of the crane, tweak the value a bit (Lot) and you have your pseudo pendulum movement.
 

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
OnClose> Open

OnOpen> Close I assume would do the trick, as well?

I knew there had to be a much more simple way of going about it. Thanks guys.

edit: It's OnFullyOpen> Close, etc. The former crashes the game, for now-obvious reasons.
 
Last edited: