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 kissofdeath · May 02, 2011 at 06:50 PM · collisionstaticbodyrigid

Colliding with static model

I have a bunch of candle models and a player character model (with a character controller).

I do not want the character to pass through the candles and I also don't want the candles to move on collision. I'm not sure how to go about doing this. If I use Rigid Bodies for the candles with a mesh collider and freeze their position and rotation, the character passes through it. If I remove either of the freeze options, then the candle moves.

I have two colliders on the candle objects, a sphere collider (for lighting the candle) and a mesh collider (for the rigid body).

The isKinematic option is not checked as well.

Can someone please guide me?

Thanks, Raja

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
0

Answer by Bryan 4 · May 02, 2011 at 06:55 PM

Just add colliders to your static objects and do not have a rigid body attached. That will ensure they do not follow physics calculations and will be stationary objects that cannot be passed through.

Comment
Add comment · Show 4 · 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 Fervent · May 02, 2011 at 06:59 PM 0
Share

Also make sure NOT to move those items with a collider and no rigidbody(static collider) as this is very expensive.

avatar image Bryan 4 · May 02, 2011 at 08:38 PM 0
Share

You can ensure they will not move by checking the Static checkbox on the gameobjects.

avatar image kissofdeath · May 03, 2011 at 03:52 AM 0
Share

Ah, I think I'm doing something totally wrong here. I'm using a character controller for the player model and I move him by just updating the transform directly (i.e. i don't use move/simply$$anonymous$$ove). If I didn't make the candle a rigid body, I wouldn't be able to use the trigger/collision messages to "light" the candle.

So, now I'm totally confused. Does the character pass through the candle simply because I "update" the transform.position to move x units in the transform.forward direction? What is the simplest way to rectify the blunders I've made?

avatar image Bryan 4 · May 03, 2011 at 03:23 PM 0
Share

Yes the character passes through the candle because you are hard setting the transform.position. The easiest fix is to use the default character controller which modifies velocity on key press, or building your own with similiar functionality.

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

Checking and destroying a rigidbody? 2 Answers

This might be simple but i'm lost. 4 Answers

Problem with damaging game object 1 Answer

Problem with Static Variable? 1 Answer

how to check collsion without rigibody? 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