• 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 dmaxwell · Oct 16, 2010 at 10:09 AM · animationcollisionphysicscharacterdoor

How to stop first person player from walking through animated door

Hi

I have a door which is animating (opening and closing) I have a first person character I walk toward the door The door close and the character walks straight through.

I understand that if they were both rigid bodies physics would correctly position them

Is there a way to parent them if they come into contact Or it is easier to add a rigid body component to the player which is activated only when they come into contact?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by IJM · Oct 16, 2010 at 07:11 PM

There is really no need to use an animated model for doors. Move the center of the Y-axis,on the door model, far right/left and rotate the model around it from the script.

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 Bunny83 · Jan 28, 2011 at 11:02 AM 0
Share

In general you are absolutly right, but think of a really complex door (best example as an old half-life player i could think of is a Combine-door) that isn't just turn around one axis, but is mounted on a kind of a robotarm. In such a case you would use an animated door but even in HL2 they placed a simple invisible "collider" inside the door that is opening or just disappearing when the door is open. That way the logical and visual function is separated.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Help with 2D Hit Detection! 0 Answers

Presure plate that triggers an animation 1 Answer

Getting collisions when using an animation to move an object? 2 Answers

Player to Door Collision and Animation 3 Answers

Two Basic Physic Questions (Gravity and Jumping) 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges