• 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 TimBorquez · Aug 20, 2013 at 08:34 PM · collisionraycastcolliderlayersignore collisions

Layer Collision issue

ok i have created a very specific problem for myself and i will try to best describe it with bullet points:

  • have path finding enemies that use raycasting to pathfind

  • have a shield on my character to block enemy bullets

  • set my shield to ignore raycast layer so the enemies dont pathfind around me

-when i fire projectiles from the player they hit the shield

so basically i need to make a way so just the player's bullets are ignored by the player's shield, but i cant use a layer cuz i need the ignore raycast layer

also i cant set my shield collider to a trigger that destroys things as that would ruin the sparks that the enemy bullets spawn

furthermore i have the enemy bullets and player bullets on the same layer so they dont collide so setting the shield to the bullet layer and ignoring raycasting would not work either...

im not sure if this problem i have made is solvable with all of these silly restrictions i created but thanks to anyone who tries to help

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

Answer by Ejlersen · Aug 20, 2013 at 08:42 PM

You could set player bullets to a seperate layer, then in Edit -> Project Settings -> Physics, you can disable physics between player bullets and shield.

Comment
Add comment · Show 5 · 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 TimBorquez · Aug 20, 2013 at 11:14 PM 0
Share

could i do it without having to change the shield's layer though cuz i definitely need ignore raycasting on it

avatar image Ejlersen · Aug 21, 2013 at 07:16 AM 0
Share

Sure, just add a new layer called PlayerBullets, then in physics you turn off physics between Ignore Raycast and PlayerBullets.

avatar image TimBorquez · Aug 21, 2013 at 07:45 AM 0
Share

ok so i guess i could make an enemy bullet layer and aplayer bullet layer and make them not collide and then make the player bullets not collide with raycast? thanks ill mess with it, im kinda new to the layer physics stuff

avatar image TimBorquez · Aug 21, 2013 at 08:03 AM 0
Share

ok yeah that solved my problem im dumb haha, thanks!

i made two bullet layers not colliding with eachother and made ignore raycast layer not collide with the player's bullet layer

avatar image Ejlersen · Aug 21, 2013 at 05:41 PM 0
Share

No problem :)

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

16 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

Related Questions

What drawback of frequently changing of Game Object's Layer? 0 Answers

Raycast Not Drawing In Target Direction 0 Answers

The Child Is Not Hovered When Passing The Parent's Collider 0 Answers

Using GetPixel via Raycasting Without Colliders 0 Answers

How can I determine how many colliders exist along a line? 1 Answer

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