I wanted to share the result of something I've been fiddling with for how the 2D walk vector magnitude is calculated in the Char.cs script.
The existing calculation works just fine for vectors that are almost entirely vertical or horizontal, but seemed to be giving unexpected results for diagonals. Characters would look like they were moving back and forth in perspective much faster than they should - which became particularly noticeable with scenes that had low values for their Vertical Movement Factor and a large difference between the smallest and largest scale on their sorting map.
The conclusion I reached was a need to bias the drop off of the reduction in the movement vector's magnitude so that it would return values closer to 'normal' speed only once the vector was much closer to horizontal.
At present I'm magnifying the Sine angle result ("upAmount" in the current code) by setting it to the power of the scene's vertical reduction factor and using that as the proportion of magnitude to remove from the original newVel vector.
Something like:
M = 1 - ( sin(A)^f ) * ( 1 - f )
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments