Swinging object?

Discussion in 'Mapping Questions & Discussion' started by Crash, Nov 27, 2011.

  1. Crash

    aa Crash func_nerd

    Messages:
    3,163
    Positive Ratings:
    4,804
    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?
     
  2. re1wind

    aa re1wind

    Messages:
    644
    Positive Ratings:
    382
    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.

    :)
     
  3. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,564
    Yea, especially with a gentle swing the barrel will settle into and idle position relatively quickly.
     
  4. Loc_n_lol

    Loc_n_lol L10: Glamorous Member

    Messages:
    726
    Positive Ratings:
    273
    there was func_pendulum, but that's goldsource only, apparently.... :(
     
  5. Kill_the_Bug

    Kill_the_Bug L14: Epic Member

    Messages:
    1,466
    Positive Ratings:
    237
    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?
     
  6. re1wind

    aa re1wind

    Messages:
    644
    Positive Ratings:
    382
    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.
     
  7. Crash

    aa Crash func_nerd

    Messages:
    3,163
    Positive Ratings:
    4,804
    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: Nov 29, 2011