Feeler weights seem to be ignored in Third Person Camera avoidance (Lyra)

Hi,

I was just going through the code of the Lyra Starter game (5.3) and I came across this section in the “LyraCameraMode_ThirdPerson.cpp” file. Specifically lines 282 - 287 in PreventCameraPenetration():

float const Weight = Cast<APawn>(Hit.GetActor()) ? Feeler.PawnWeight : Feeler.WorldWeight;
float NewBlockPct = Hit.Time;
NewBlockPct += (1.f - NewBlockPct) * (1.f - Weight);

// Recompute blocked pct taking into account pushout distance.
NewBlockPct = ((Hit.Location - SafeLoc).Size() - CollisionPushOutDistance) / (RayTarget - SafeLoc).Size();

Do I get this wrong or does the last line cancel the calculations done before that, effectively rendering the whole feeler-weight stuff useless? Should there be a *= in the last line?

Cheers,
Simon

Hi Simon,

Looks like it’s being overridden to me. I don’t have that project in front of me so I don’t exactly know what else is happening to calculate CollisionPushoutDistance or RayTarget, but the first three lines don’t have any effect on the result for NewBlockPct.

Godspeed developer!

Hi,

Thanks for confirming that for me.
Let’s see whether it might be changed in the next version of Lyra :wink:

Cheers and all the best.

1 Like