There’s a lot of warnings about moving static colliders, but I’m a bit confused about static colliders in 2D.
I have an infinite runner game where the ground is spawned when the player moves. To avoid lots of Destroy and Instantiate calls I’m using a pooling system. The ground consists of groundblock gameobjects that simply have a box collider attached. No rigidbody. When the player moves forward, I’m effectively moving blocks from behind the player to infront of him. Hence, I’m moving static colliders - a big no-no. How do I remedy this? The approach in 3D would be to attach a rigidbody to my groundblocks, check isKinematic and change groundblock.rigidbody.position, which is a lot faster than groundblock.transform.position on a static collider. However, the Rigidbody2D doesn’t have a position member, nor does it have a movePosition method.
What’s the approach here?