Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Curb · Nov 03, 2014 at 10:42 AM · c#mecanim

Multiple points of interest in conjunction with mecanim head look

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?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ben-BearFish · Feb 11, 2015 at 11:45 PM 0
Share

@Curb, any luck on finding a solution for this?

avatar image incorrect · Feb 12, 2015 at 02:51 AM 0
Share

Ben BearFish, look! I've found one. :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by incorrect · Feb 12, 2015 at 02:51 AM

It does not worth bothering about resources in such task because both solutions, calculating distances or using colliders, if done properly, work extremely fast in comparison to other in-game processes.

So what should worry you is which way is easier for developer. Obviously, just calculating distances and picking one target is easier in terms of adjusting. if you make it right, it will work fast and simple.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

28 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

How to use mecanim to play specific animation clips when public static int condition is reached? 2 Answers

Making a bubble level (not a game but work tool) 1 Answer

Does Mecanim only change states after a frame? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges