Infinite collider
I am making a 2d game and was wondering if there was a way to collider go forever, and how to make my floor go forever, (Random generation would be great but I will be fine with the same pattern over and over again)
Answer by theterrificjd · Dec 14, 2017 at 12:20 AM
If your motion is without physics, you can just constrain the target's X and Y axis to where you want ( you can even use Camera.ScreenToWorldPoint. It's been a while but I'm pretty sure ScreenToWorldPoint(new Vector2(0,0)) would get you the top right, and 1,1 would be the bottom left. 1,0 is top left, and 0,1 is bottom right.
Alternatively, here's another answer that actually generates the collider boxes: https://answers.unity.com/questions/1442077/top-down-shooter-boundariesspace-shooter-creating.html?childToView=1442118#answer-1442118
A quick alteration of that putting that last set of code inside of an Update function should cause it to stay live in case your player actually moves through the world. Depends on how your game works, though.
Answer by iveL_newO · Dec 14, 2017 at 05:37 AM
I just have a long flat floor and I want it to go on forever, thanks for replying anyway.
Your answer
Follow this Question
Related Questions
How to make an infinite floor 2D 0 Answers
infinite jump when I use confiner, cinemachine,infinite jump when I use confinder 0 Answers
Raycast Reflection 2D 1 Answer
My trigger won't activate the UI when the player collides with it. 0 Answers
2D RigidBody slightly penetrates objects causing a bounce effect. 3 Answers