Forum Replies Created

Page 3 of 3
  • Demarc Johnson

    November 8, 2017 at 7:12 pm in reply to: Delaying Parented Rotation

    You can use the valueAtTime method to do a delay in the hat’s rotation. The valueAtTime method offsets a property’s value by time.

    var delay = thisComp.frameDuration * 2; //This will delay the frame by 2, but you can change it to whatever number you want
    thisComp.layer("Head").transform.rotation.valueAtTime(time - delay); //Pick whip the head's rotation and add the valueAtTime method, then subtract time with the delay variable in the parenthesis.

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    November 8, 2017 at 1:17 am in reply to: Follow moving objects in 3D space

    Sure Target should work. Sure Target allows you to pick a target/3D layer and go from one layer to the next regardless of if it’s static or not, but for some reason that is not the case try this.

    Create a null object
    Create a camera and parent the camera to the null.
    Separate the dimensions of the null position for more control.
    Create a Slider Control and set the max value to 1 less than the amount of planets you have.

    var Mars = thisComp.layer("Camera Control").effect("Layer Control")("Layer"); //Create a Layer Control in the null object or pick whip each planet position and put it in a variable.
    var control = thisComp.layer("Camera Control").effect("Layer Control 2")("Layer"); //Create a Layer Control in the null object for this layer or get this layer position.
    var Earth = thisComp.layer("Camera Control").effect("Layer Control 3")("Layer");
    var arrList = [control, Mars, Earth]; //Put all of the variables of the planets and the null object in this array.
    var planetAmount = arrList.length;
    var slider = thisComp.layer("Camera Control").effect("Layer List")("Slider");
    var prevTarget = Math.floor(slider); //This will get the previous target number in the array in slider
    var nextTarget = Math.ceil(slider); //This will get the next target number in the array in the slider
    var sliderLimit = Fslider === planetAmount - 1 ? 0 : 1; //This will prevent slider from going beyond the array object.
    var prevTargetPos = arrList[Fslider].transform.position.value; //If you choose to pick whip the position of the planets then get rid of transform.position.value and do the same with nextTargetPos
    var nextTargetPos = arrList[Fslider + sliderLimit].transform.position.value;
    linear(slider, prevTarget, nextTarget, prevTargetPos, nextTargetPos);

    If you want a sudden zoom from one parent to the next, then use the Math.floor() method on the slider in the linear method.

    Rather you chose to pick whip the planets and null’s position or use the Layer Control, stick with that one choice for all of the planets and null variable or else the code will break.

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

Page 3 of 3

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