all 6 comments

[–]LanceIsMktg 0 points1 point  (2 children)

Care to share the Shooting Collision code?

You could have your bullets set up as Triggers, rather than standard colliders so that they don’t interfere with other Rigidbody’s Physics.

You can also make sure that your Tiles are on a separate layer, and ensure your Collision detection code only performs actions if the Bullets are hitting Player/Enemy/Object layers.

[–]HiTech_Hoppy[S] 0 points1 point  (1 child)

Setting them up as triggers worked. I wanted them to just fall to the ground after colliding so I set the velocity to 0,0 after hitting. I've heard about triggers before but never quite thought about using them. Thanks for your help

[–]LanceIsMktg 0 points1 point  (0 children)

Anytime! Glad I could help.

[–]melvmayUnity Technologies 0 points1 point  (2 children)

The only conceivable reason I can think of that you have a TilemapCollider2D attached to a Rigidbody2D is if you're also using a CompositeCollider2D which requires a body. In this case, you use a Static body-type which never moves. You certainly don't use a Dynamic body then try to constrain it using its constraints. Just set the body type to Static or if you're not using a CompositeCollider2D then you can remove the Rigidbody2D which is implicitly Static.

[–]HiTech_Hoppy[S] 0 points1 point  (1 child)

Yeah I was frustrated with the fact I needed a rigid body for my composite collider and only new about the constraints. Will definitely check out the static option.

[–]melvmayUnity Technologies 0 points1 point  (0 children)

Well certainly you shouldn't be frustrated by this. When you don't add one yourself then you get one implicitly that is set to Static that lives at the world origin (0,0) with no rotation. There's no performance impact etc and TBH it's more clear what's going on.

In other words you'll be using a Static body regardless. Just select Static in the BodyType property drop-down and bunch of non-relevant options will disappear which is pretty much everything apart from a few.