Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression >> Attract a layer to a null object (pos) >> Adding a slider

  • Expression >> Attract a layer to a null object (pos) >> Adding a slider

    Posted by Graham Smith on January 12, 2025 at 1:04 am

    Hi all,

    This is the attract layer to null object position expression

    thisComp.layer(“YourNullObjectName”).position;

    The trouble is when added it’s an instant snap to the destination null object. Is there anexpression i can add or alter this, so i can highlight a number / strong of the attractor and then expression pick whip this to a slider control? Much in the same way we do to the wiggle expression to use velocity to turn it on and off.

    I’m looking to be able to use a 0 to 100% method with keyframes on a slider controller. So i can then add velocity and really chosen how to craft the animation to suit.

    recent to the above i have worked out that i can add an expression to a layer object and then use 2 nulls to move using a slider. this one..

    linear(pick-whip-slider-value-here, 0, 100, pick-whip-null-1-position-here, pick-whip-null-2-position-here)

    the thing is i have hundreds of objects already, so i’m trying to work out if i can get the slider setup into this starting point ( “thisComp.layer(“YourNullObjectName”).position;” ) , so i’d only have the object layer and 1 null, which would be better and more manageable.

    love to hear your views and feedback please

    Graham

    Amman Wahab replied 1 year, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • John Cuevas

    January 13, 2025 at 2:29 pm

    First things first, there is an AE Expressions forum with the absolute best expressions guy ever, Dan Ebberts, so you might want to post there first.

    I have a few questions though. Is the null moving? You have hundreds of objects, and they are all going to be going to the null, is there going to be a delay between object 1 then 2, then 3… are they going to be following each other like a snake or train?

    Again, it will probably be quicker if you ask Dan, but these are details he will probably need also, but if he’s not around, I’ll try to muddle my way through it.

  • Amman Wahab

    January 13, 2025 at 9:58 pm

    Hey Graham, I get it; you want to avoid setting everything up again. Maybe you could try nesting your current layers into a pre-comp, then apply a single null object to control everything? Just a thought. Not sure if it’ll work exactly as you want, though.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy