I’m working on some 3rd person camera BP code, and found what appears to be an overlap event bug and a 1-frame rendering bug.
My game has a number of pawns that player can switch between.
Instead of having camera boom shorten automatically by turning “camera block” on in collision for all pawns, I have it generate an overlap event instead. This allows active pawn to move among other pawns without camera zooming rapidly in and out – instead, I want camera to only zoom in or out when it’s close to intersecting another pawn, so it doesn’t “cut into” other pawn.
first bug I’ve found is that if I only change boom length of camera arm (zooming in and out using mousewheel down and up), it does not generate an overlap event of either begin or end. This is bug #1.
At first, I tried to add a tiny amount to controller yaw input to trigger an overlap event whenever I change camera boom arm length, which sort-of works, but didn’t seem to be consistent. I was able to make it consistent by setting a flag and subtracting same amount to controller yaw input on next event tick.
Then I added code to test zooming in when an overlap is detected, and found a second bug:
if changing boom length allows an entirely-obscured object to be shown, it isn’t drawn for 1 frame (or 1 event tick?)
For example, one of my test characters is wearing a helmet, which is a separate object attached with a socket. If I zoom in on another pawn such that helmet of my active pawn is obscured behind other pawn, once camera pops past other pawn, my active pawn is seen for 1 frame without helmet. If active pawn is far away enough to be entirely covered by foreground pawn, it isn’t drawn at all for 1 frame (and then immediately appears).
This happens in both editor and if I build it and run app.