Copy link to clipboard
Copied
(Arial View) So here is what I am trying to do. I make trucking tutorials and i am trying to show a truck and trailer make a right of left-hand turn. Is there a way to make the back of the trailer follow a different path than the front of the trailer?
This animation is a real truck and trailer recorded from a drone and i had to crop taking still images and throwing them into photoshop the get rid of the ground and then throwing them into premiere to playing them in sequence. I really just want to do it in after effects without having to rotate the trailer when it is following a path.
1 Correct answer
Your YouTube video requires a password.
The trailer is not going to follow the same path as the truck. You have two options. One somewhat automated, the other manual. Depending on the shot manual might be easier. Let's start with Manual:
- Select the pen tool and draw a new shape layer with only a thin stroke to describe the path of the truck, set a Path keyframe and cut it.
- Add a truck Null to the comp, Press Alt/Option + p to set a position keyframe and paste so the null follows the truck pa
Copy link to clipboard
Copied
The GIF isn't working.
You have one anchor point per object and position is bind to this point. If the object follows a path, it's in relation to this point. There is not way to get a second anchorpoint to the object.
But what you try to achieve sounds pretty easy, so if you could give us an image and the desired outcome, I think there are at least 3 solid ways to do it.
*Martin
Copy link to clipboard
Copied
Copy link to clipboard
Copied
dont know why the gif didnt work
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Your YouTube video requires a password.
The trailer is not going to follow the same path as the truck. You have two options. One somewhat automated, the other manual. Depending on the shot manual might be easier. Let's start with Manual:
- Select the pen tool and draw a new shape layer with only a thin stroke to describe the path of the truck, set a Path keyframe and cut it.
- Add a truck Null to the comp, Press Alt/Option + p to set a position keyframe and paste so the null follows the truck path
- Select the pen tool and draw a path for the trailer on a different shape layer, set a path keyframe for the path and cut (Ctrl/Comd + x)
- Add. trailer null to the comp, press Alt/Option + p to set a position keyframe and paste so the trailer null now follows the trailer path
- Select the Truck null and press Alt/Option + Ctrl/Cmnd + o to open up Transform>Auto Orient and select "orient to path"
- Select trailer null and press r to reveal the rotation property and then paste this expression to rotation so the trailer null always looks at the truck null position
L = thisComp.layer("Truck Null "); p1 = fromComp(L.toComp(L.anchorPoint)); v = p1 - anchorPoint; value + radiansToDegrees(Math.atan2(v[1],v[0])) ​
- Add your Trailer and Truck graphics to the timeline and position the anchor point for the Truck over the fifth wheel or center of the rear wheels and set the anchor point for the Trailer over the center of the back wheels
- Hold down the shift key and Parent the Trailer layer to the Trailer null to snap it into the same position as the null
- Hold down the shift key and parent the Truck layer to the Truck null to snap it into the same position as the null
Now you are setup. All you have to do is adjust the timing of the motion of the truck and the trailer so they look like they are hooked up. The truck will rotate around the back wheels as a real one would, the trailer will rotate around the back wheels and always be pointed at the hinge pin (fifth-wheel) of the truck. All that is left is to adjust the timing of the keyframes for the truck and trailer so that the trailer maintains the same distance behind the trailer. It should be pretty easy to do when the truck and trailer are moving in a straight line. The corner is probably going to require you to add a few keyframes and even adjust the path so that it looks natural.
Your comp will look something like this:
I have shown you everything you need to see to duplicate this setup.
 
A more automated way is to set up inverse kinematics between the truck and trailer using expressions. I'm not going to go through all of that at this time. It takes some time to understand and most of the IK solutions out there require a fair amount of understanding of both expressions and the AE UI.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
A modified true Inverse Kinematic set of expressions will probably work much better. With the right modifications, you would only need one motion path for the truck. The trailer's distance from the 5th-wheel would remain set and the trailer would always be connected to the tractor (truck) The modifications you would need to make would be to create some kind of virtual rolling friction or some spring tension in the hinge to get the trailer to follow the tractor in a realistic way.
I don't have time to work that out for you right now but I suggest that you check out Dan Ebberts Motionscript site or hope he sees your thread. There's plenty of info at Dan's site to get you started if you want to spend a fair amount of time diving into expressions.