I’m a beginner. And I don’t know which of the numerous methods for initiating events in a game would be best for my project. So a word from the wise could save me months of splashing around in the water.
I want to allow a player to step through a sidewalk scene using a first person character controller. And whenever any of a set of targeted objects enters his/her limited field of view, an animation that is associated with that object(s) is played.
For example: If the person simply passes a store and the object peripherally enters the scene, then nothing happens. But if he turns his head towards the store’s window, and a targeted object comes within that tighter field of view, then the associated animation begins.
Another example: The person can simply walk past a silent dog on the sidewalk. But if he turns his head slightly to look at the dog, it barks.
A Raycast seems too limited/precise. (The targeted objects would have to pass through the center of the scene in order to trigger the associated animations.)
Can (should) a “detection radius” be associated with the first person character instead?
Here’s a link to an game example using a “detection radius.” But I haven’t found the associated code.
Any other suggested strategies and/or code examples?
Thanks