'In a probuilder object with inverted normals. Collision seems to not work with this one item
I have made my level out of a probuilder object that has inverted normals so the player may exist inside of it. This has caused some issues as for some reason. The projectiles that my enemies create ignore the player, only when inside the level. As when I take them out and test them on a flat plane, it works fine.
The code for the Bullet Finding Player Collision :`private void OnCollisionEnter(Collision collider) { playerHitbox target = collider.gameObject.GetComponent();
if (target != null)
{
PlayerManager.instance.takedmg(dmg);
Destroy(gameObject);
}
else
{
Destroy(gameObject);
}
}`
to note, everything has a capsule or box collider.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|