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 Bluewave · Nov 29, 2010 at 06:33 PM · aitimenpcaction

A set of actions

Hi, Im new to programming and was wondering how can i achieve this:

I want my npc to go from point A to B and vice-versa where B is a book shelf. I want the npc to look at the shelf and read a book (i can enable/disable the book) what i would like to know is how to make it stop at the right place everytime. Another one will be having the npc to go sit at a chair. How do i make it go to the exact spot, turn the right direction, play the sit animation and stay at the right position.

Other question would be how do i make my npc do his/her actions based on time say for example do one thing at 3 o'clock do another at 4.

Thanks in advance

Comment
Add comment · Show 1
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 profewalker · Aug 27, 2012 at 03:42 AM 0
Share

Hi,

Sometimes its easier to take advantage of a great tool that handles your AI for you, so all you need to do is focus on the fun.

If you are in need of a great AI system, I just wanted to let you know about AI Behavior $$anonymous$$ade Easy in the Asset Store. You can create and easily modify dynamic AI Behaviors for your game projects with one simple tool.

There are 12 AI Behaviors ready to go, to be combined, added to, and duplicated to do more. With the advanced system release on the AI states, you will find it easier than ever to give each of your characters their own personality and behaviors.

Be sure to read up on the links for more information.

Hope this helps!

Forum Link

Asset Store Link

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jesse Anders · Nov 29, 2010 at 06:54 PM

IMO, the question is a little broad for Unity Answers. You're not so much asking a specific technical question as you are asking how to do a number of fairly complex things in general terms. As such, there's really no concise answer.

That said, here are a few tips. First, you'll probably want to look into finite state machines, as that would probably be the most straightforward way to keep track of what the character is doing and to cause certain actions to occur.

As for doing actions at certain times, you'll first need to determine where the information about time will come from. What does '3 o'clock' mean in the game world? Is that 3 o'clock real time? Relative to when the game started? Is the time abstracted or compressed in any way?

Once you have the source of time figured out, causing the character to perform certain actions at certain times will then be a matter of assigning a new state to the character (with respect to the aforementioned FSM) at the appropriate times.

The rest depends on a number of things, but it will most likely involve a combination of playing certain animations (as you suggested) and moving the character by modifying the game object transform, or moving the character controller or rigid body (if the game object has one). If sitting in the chair needs to be procedural, I'd recommend first moving the character to an appropriate point directly in front of the chair, then rotating the character until the forward direction vector is more or less aligned with the chair's forward direction vector, and then playing the 'sit' animation.

Beyond that, I'd recommend narrowing things down to more specific, single questions, and then posting those questions to the forums or Unity Answers individually.

Comment
Add comment · Show 1 · 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
avatar image Bluewave · Nov 29, 2010 at 07:17 PM 0
Share

Hi, Sorry about that and thanks for the tips.

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

1 Person is following this question.

avatar image

Related Questions

How to set priority over certain actions? 1 Answer

Making an AI for an NPC 1 Answer

Help needed for a dialogue/speech System 1 Answer

Making AI that can navigate through a city? 3 Answers

Moving from one position to another 3 Answers


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