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
1
Question by Lethil · Jun 22, 2012 at 10:42 PM · collisionrigidbodynetwork

Two gameobjects with rigidbody aren't colliding in network game

I'm having an issue with two gameobjects representing players. Collision works when they run into items on the map (which makes sense since that's local for each of them), but they don't seem to successfully collide with each other. Instead, they move through each other.

Is there something I'm missing in order to enable them to collide with each other?

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Lethil · Jul 02, 2012 at 12:27 AM

I found the problem. It was a simple one: I was trying to collide 2 mesh colliders. I just found out that can't be done. I don't need precision, so I switched to 2 sphere colliders and it works like a charm!

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

Answer by Berenger · Jun 22, 2012 at 11:14 PM

They might be triggers, or on layers that don't collide with each other. I suppose you're using AddForce to move or else you wouldn't collide with items. Try implementing OnCollisionEnter and OnTriggerEnter in scripts attached to those character, to check if something happens.

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

Answer by Lethil · Jun 22, 2012 at 11:23 PM

They're both clones of the same object and are both on the same layer. I use AddRelativeForce and AddRelativeTorque to move and rotate them. They have an OnCollisionEnter() call on their script, but not an OnTriggerEnter().

Collision is set to ContinuousDynamic.

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

Answer by sweatyrat · Jun 28, 2012 at 08:01 PM

what is your NetworkView.observed? you should have it set as the objects rigidbody. and if so then it has to be a problem with the server's collision detection because the clients will just do what they are told. are you applying those AddRelativeForce and torque on fixed update? that messes it up sometimes as well.

but if you are manually serializing values by setting your script as the NetworkView.observed then my guess would be there is a problem with the implementation there. like you have both the server and clients apply the values from OnSerializeNetworkView(stream : BitStream, info : NetworkMessageInfo) {} when stream.isWriting or something.

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 Lethil · Jul 01, 2012 at 08:23 PM 0
Share

I'm doing some refactoring to make my code authoritative-based. Once that's done, I'll test run through your thoughts here and see if they fix the issue. I was on fixed update for Force and Torque, but I've moved them both to Update. :)

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

how effect physically on the other game object with rigidbody when collision in the network unet 0 Answers

How to add physics to an animation? 3 Answers

My Character controller is being push a little bit when i'm about the get the coins. How can i possibly detect collision and destroy the coins without actually getting affected by the colliding physics? 1 Answer

How can I apply a force to an object in the opposite direction of the object it's colliding with? 2 Answers

Objects with colliders going through walls and each other. 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