Any guidance on animating NPCs based on camera look?

Title pretty much says it all!

I’m looking to animate the facial expression of NPCs based on where I’m looking in a first person game. Basically, as I’m looking away from an NPC I’d like their smile to get wider and wider, and more terrifying. The camera will be implemented in both VR and flat screen.

Even being pointed toward some functions or relevant docs would be helpful. Like I’m sure many people here, I’m a new user!

Thanks in advance!

Welcome back to the community and thank you for posting here.

From reading your post, it sounds like you would benefit from creating blendshapes in your 3D editing software and then controlling their values in editor.

Here is documentation on Blendshapes:

In regards to the “as I’m looking away” portion, I would consider using dot product to find the current angle the player is looking. You would be able to use the result to change the blend amount. Below is a very quick way of obtaining the float value.

Of course, this is only the start to a major mechanic and there are many methods and pipelines to try out. I do wish you the best in this.

Thank you so much for this response. Exactly what I was looking for - a place to get my feet wet in the docs, and some really great guidance.