- Home /
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
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.
could i do it without having to change the shield's layer though cuz i definitely need ignore raycasting on it
Sure, just add a new layer called PlayerBullets, then in physics you turn off physics between Ignore Raycast and PlayerBullets.
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
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
Your answer
Follow this Question
Related Questions
What drawback of frequently changing of Game Object's Layer? 0 Answers
Ignore collisions between a certain collider and a layer 2 Answers
Remove collider vs putting on a layer that ignores collisions 2 Answers
Detecting collisions with raycast or not? 1 Answer
Raycast doesn't register Rigidbody 1 Answer