In my top-down racer game, if the Car overlaps a piece of road (the Onramp), there are several layers (for now, just "Road" or "Overpass") which are meant to zoom in or out based on the lerp value of the Car on the Onramp.
1. Car overlaps Onramp (single object with four different animations for its up, down, left, or right-facing position).
2. C3 calculates either the X or Y unlerp value depending on the position of the Car and whether the Onramp is facing up/down or left/right.
3. Using an off-screen "Zoom Meter" object with the Tween behavior, I Tween the Zoom Meter to the unlerp value as determined by the position of the Car on the Onramp.
4. The Tween is meant to arrive at the corresponding unlerp value shortly after the Car gets to its at-that-moment position.
5. Using the Value of the Tween, I update the scale Road and Overpass layers.
Just in case that didn't make much sense, this is what it's supposed to look like...sort of.
Not properly illustrated, as I stated above, is that the actual zooming/scaling will be "lagged" behind the actual position of the Car relative to its position of the Onramp. It should act like this (which is where the Tween comes in):
C = Car
Z = Zoom/Scale of layer
Basically, the Zoom is always playing catch up to the unlerp value of the Car's position on the Onramp. If the player slows down on the Onramp or even stops, then the Tweening of the Zoom value should eventually (like, within a few seconds or LESS) match up.
Problem is I'm having trouble properly making this work. I had it set up before where it would update the Zoom based on the at-that-moment unlerp value, but not with a delayed value.
Here's a screen-shot of my current event/action set up:
I hope that all made sense...
Can someone help me see where I made my error? Thanks.