Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by CoolCosmos · May 13, 2018 at 10:53 AM · ignorecollision

Ignore Layer Collision

-Hi guys, I am trying to make a multiplayer game. I have particle effects to fire. I spawn particle effects from inside of player. I also have two layers named "LocalPlayer" and "RemotePlayer". But i have an issue.

  • am using "IgnoreLayerCollision" code to stop colliding the collision between Particle effect and Player so i can spawn particle effect from inside of player.

-Firstly, i stopped the collision between Local player and particle effect and then i stopped the collision between Remote player and particle effect.

-But i encountered an issue. The issue is this; After i built game, On built version, when i fire particle effect, it succesfully gets spawned from local player but on unity's side the local player is being remote player and it is not colliding the other players.

-The thing that i am trying to do is; particle effect won't collide the player it gets spawn but others. I hope you understand me when you watch the video that i am sharing with you. If you help me, i will be overjoyed. Thanks.

-https://www.youtube.com/watch?v=ZKyuTSkgW9I&feature=youtu.be

-This is the code i am using;

public void IgnoringCollision() { if (isLocalPlayer) { Physics.IgnoreLayerCollision(9, 12); } else { Physics.IgnoreLayerCollision(10, 12); } }

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 Okido · May 13, 2018 at 11:51 AM

Seems like it might be to do with the "islocalplayer" condition in the if statement? Have you tried removing that condition? Or removing the code altogether and unchecking their collision in Unity's Layer Collision Matrix?

(Edit > Project Settings > Physics)

Layer Collision Matrix

Comment
Add comment · Show 3 · 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 CoolCosmos · May 13, 2018 at 12:02 PM 0
Share

If i remove if the code, particle effects will colide the player that spawn. I tried the layer collision matrix. It does same thing with the code i wrote.

avatar image Okido CoolCosmos · May 13, 2018 at 12:08 PM 0
Share

In the Unity editor, just head to Edit, Project, Physics. Then the Physics $$anonymous$$anager will come up in the Inspector. Expand the "Layer Collision $$anonymous$$atrix" section, and you can see what collides with what. Uncheck anything that you don't want to collide (:

avatar image Okido Okido · May 13, 2018 at 12:11 PM 0
Share

I've added an image to the answer to make it clearer - hope it helps!

avatar image
0

Answer by CoolCosmos · May 13, 2018 at 12:36 PM

Sorry but that didn't help. :(

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 Okido · May 13, 2018 at 10:06 PM 0
Share

Ah, sorry to hear. I guess I'll eave it in case it helps anyone else, but I hope you figure it out. Let us know when you do!

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

139 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can't make bullet ignore colisions 0 Answers

It is possible to filter and ignore collisions by a Layermask? 0 Answers

IgnoreCollision not working 0 Answers

Physics.IgnoreCollision between rigidebody2d+polygone collider 2d and edge collider 2d doesn't work? 1 Answer

No errors console but Physics2D.IgnoreCollision does not work 0 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