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 Michael 12 · Apr 02, 2011 at 01:22 PM · aidoorenemyai

Is it possible to make enemies Open doors?

Prety straight forward question. In my FPS game I'm working on I want to have one of my "Alien Zombies" start off in a little outhouse (Sounds strange I know) but the out house has a door and I'm wondering if after he chases my FPS player and say for some reason I don't have a gun so I run away and get out of range I'm wondering if there is a way to make him return to the Outhouse but he would need to open the door. is that possible for enemy AI? and if so how would I script that? I guessing Raycast or maybe a box collider that only my Alien Zombie triggers somehow?

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Justin Warner · Apr 02, 2011 at 02:08 PM

Um...

Call of Duty 2 had their AI actually have an animation of "kicking" the door open...

But really, just have an animation of either, the door opening (You can have him open the door or you don't need to... It's really a matter of preference assuming that the player can't even see it)...

To actually have this happen... Use the AI system, I'd assume you have a target variable, so instead of going to player, make him goto outhouse, if he collides with the house, then the door opens, and he can go in to it... Alternatively you can remove the collider on the door on collision, (Or where ever the zomby collides with it), and so he just keeps walking towards it...

Their's a lot of ways to go about this lol.

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 Michael 12 · Apr 02, 2011 at 05:04 PM 0
Share

Would a Waypoint not work better for making him return to the outhouse after giving up chasing my FPS player when he gets out of range. And lets say my player turns and waches to see where my Alien Zombies goes to, then he would actually need to see him open the door. BTW my outhouse does have an open and close door animation which my FPS player makes work very easily using raycasts when at a certain distance from and only faceing the door. Wondering if the same technique can be used for my Zombie to open the door?

avatar image
0

Answer by AngryOldMan · Apr 02, 2011 at 02:37 PM

if your not seeing the zombie go back to the outhouse then add a layer to the collider on the door. Make sure that the player can't go through this layer but the zombie can. It's the quickest method involves no scripting, layers are similar to tags (also to the left of the tag sectoin in the inspector) and they are incredbly useful for controlling specific collisions, eg if you have an invisible wall which you want to be able to shoot through but not let the player walk through, or if you have a door which an enemy can walk through but your player cant walkthrough (just like your situation) :)

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 Michael 12 · Apr 02, 2011 at 05:00 PM 0
Share

Hmmm I think I understand some of what yur saying. Currently my FPS player can open the door and even hide inside of the outhouse if it's unocupied by Alien Zombie that is lol But if my Zombie atarts off in there and my player opens the door without a gun, sees the Zombie, Runs away, Zombie gives chase untile my Player is out of range, then returns to the outhouse (Waypoint needed I guess)? If my player turns to watch and see where he goes then he would need to see him open the door and not pass through it. So I'm wondering how that could be done?

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

No one has followed this question yet.

Related Questions

Check lenght from player? 2 Answers

Problem with the movement of AI 1 Answer

Make an object move towards a Player 1 Answer

Getting my guard AI to detect fellow guards 0 Answers

How do you make a enemy AI hear approaching footsteps? 2 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