Error when animate the FOV of a virtuel camera

Hi,

ich got the error each fram when i animate the FOV of a virtuel camera:

Assertion failed on expression: ‘SUCCEEDED(hr)’

this error does not crash my game, even can run, but i still can feel that animation of FOV is not very smooth, what is happens and how can i get ride of this error?

thanks in advance :slight_smile:

Normally there should not be an error.
How are you animating the FOV?

i use the animation in Unity and set the FOV with 8 at 0 fram in the end FOV with 25, every fram shows the error when the animation plays…

New
i use the animation in Unity and set the FOV with 8 at 0 fram in the end FOV with 25, every fram shows the error when the animation plays…

I still don’t understand from your description. This is not an error we have seen before. Normally animating the FOV does not cause a problem. Can you make a small project that reproduces the problem and log a bug?

@Gregoryl I actually am getting this error as well when doing the exact same thing, although everything seems to function as expected so I’m not sure what it means. I’m doing this with a 3rd Person Follow vcam. This is the code I’m using:

m_vCam.m_Lens.FieldOfView = Mathf.MoveTowards(m_vCam.m_Lens.FieldOfView, ZoomedFieldOfView, MaxFieldOfViewDeltaPerSecond * Time.deltaTime);

I’m probably going to change the solution to instead blend to a completely separate vcam since I may want to change more than just the FOV in the future, but still an interesting issue.

Edit: I actually get this issue even when blending to a camera with a different FOV. I’ll see if I can make a small repro project.

1 Like

@Gregoryl Just updated to the latest LTS version 2020.3.21f1 from version 2020.3.13f1. So far I haven’t encountered the issue. If I ever encounter it again I will try to isolate the problem, but it seems fixed. For the record I actually noticed that the error would even happen sometimes when just selecting a GameObject and focusing on it (pressing F), so it seemed like some general underlying issue, not specific to FOV.

Edit: I take it back. Just encountered it again when resizing the Game window in editor while the game was playing. I’ll try to make a repro project tomorrow.

2 Likes

Unfortunately I wasn’t able to reproduce this in a brand new project. I thought maybe it is due to Cinemachine as it is camera related, but adding Cinemachine didn’t reproduce the problem either. It is intermittent and doesn’t seem to affect anything and I just don’t have the time to try to slowly strip things out until I figure it out. If I ever figure it out by accident I’ll post back here.