• 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
1
Question by Papa Stanley · Dec 09, 2009 at 06:35 AM · collisionphysicsterrain

Terrain and rigidbody not colliding - boat versus bank

Hi Unitarians,

I have a terrain and a rigidbody modelling a boat and a riverbank. The terrain has the standard collider, and the boat has a rigidbody with kinematic set, as the movement is controlled via script, not the physics engine.

The problem is the boat will simply sail through the terrain I have generated, when I want it to crash. I have tried swapping the terrain collider for a rigidbody collider, and also adding a character controller into the boat, in addition to the rigidbody. Not$$anonymous$$ng works.

The boat is limited to one plane of movement, and it will intersect a water plane as well for the illusion of flotation.

Do I need to somehow turn on collisions? I thought t$$anonymous$$s was handled automagically by the physics colliders? Is kinematic the problem?

if I turn off kinematic, and turn on gravity the boat falls. It is above the base plane of the terrain mesh BTW. What gives?

Thanks in anticipation

Papa

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
2
Best Answer

Answer by Jaap Kreijkamp · Dec 09, 2009 at 07:06 AM

First, you either need to add a collider or a CharacterController to get collisions. Best in your case is CharacterController, otherwise you need physics with kinematic OFF. If you have a charactercontroller added you can remove the rigidbody and all other colliders. Move the object using the Move methods in the charactercontroller instead directly on Transform. You can still rotate the normal way. The collisionflags of the charactercontroller can be used to determine collisions.

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 Papa Stanley · Dec 10, 2009 at 06:18 AM 0
Share

thanks mate, that seemed to do the trick - once I mucked around with a fresh controller and terrain using the CC movement example from the reference, then I started porting my movement script over without much drama. Should have RTFM I know ;-)

For others who have to do this - most changes simply involved adding the controller object before the original rigidbody transform.Rotate calls, eg transform.Rotate(Vector3(blah... becomes controller.transform.Rotate(Vector3(blah... where controller is the instance of the CC. YMMV but worked for me.

thanks for your help Jaap, and timely reply

.:S:.

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Irregular ground collision 1 Answer

Player's Rigidbody slides up terrain walls 1 Answer

Terrain collider failing in unity 5/17? 1 Answer

Collision Colliders - Box or Mesh for Terrain 1 Answer

Innacurate terrain collision with fast rigidbody 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