Quantcast
Channel: Latest Questions by Curb
Viewing all articles
Browse latest Browse all 36

Multiple points of interest in conjunction with mecanim head look

$
0
0
I'm trying to make a character look at "points of interest" in the world by use of the mecanim head look functions. This works, however I've got a question about how to handle multiple "points of interest" in the same scene at the same time. Right now I've got it like this: The POI is an empty gameobject with a special tag. I've set out multiple of these in the scene and at the start of the scene I generate a list with these objects. I then check this list every second or so (as faster isn't really needed) which object is nearest, and if it is the nearest object, I check if it's actually in range to trigger the headlook. This works. With some custom weighting the character smoothly looks around the POI's that are nearest to him. However, I was wondering if there might be a more friendly solution.. I'd like to avoid having to check for distance every second for all the different objects in the scene. Would it be less resource intensive with setting up colliders on the POI objects and checking for OnTriggerEnter? I have no idea how resourceintensive using ontriggerenter is, cause I assume its also checking stuff out every frame. So my question is: How to best tackle multiple points of interest in a scene in conjunction with the mecanim headlook functions?

Viewing all articles
Browse latest Browse all 36

Latest Images

Trending Articles





Latest Images