Added changeable ground dimension feature.#2
Added changeable ground dimension feature.#2AliShahsavandInanloo wants to merge 2 commits intokeyserjaya:mainfrom
Conversation
keyserjaya
left a comment
There was a problem hiding this comment.
Hi, first of all.
Thank you for your pull request!
I've tried your code and there's a few bug:
- groundPieceSize didn't works
- using System; is missing
Also, i have suggestion:
- Change System.Math.Floor to UnityEngine.Mathf.FloorToInt()
That's it, everything is nice, just a little revision left
|
Hey, I've applied the changes that you requested, and also I have fixed the "using System; is missing" bug. There is just one little problem with the groundDimension, when we input it with 5 and 9 and probably some other odd numbers, when you put 5 it should give you a 5 x 5 ground which has 25 pieces, but it gives 16 pieces and there is the similar problem with number 9, it doesn't generate 81 pieces it generates 49 (which is 7 x 7). |
keyserjaya
left a comment
There was a problem hiding this comment.
Hi, i have tested your code and sample scene.
It was great, because you're using mesh bounds as _groundPieceSize.
Unfotunately there's still bugs:
- When change Ground Dimension (i tried 9) the next ground will be too far
- The _newGroundTrigger was too far, because the target(player) must be too corner to trigger new ground (so the empty space was visible to the camera).
Solution: new float triggerRangeMultiplier will be good.
Sorry to many request, because i want the users to get nice working code.
Also thank you so much for your collaboration!

Hey, I recently found your infinite ground script which is pretty dope, but it was limited to just 9 grounds. so I decided to make it unlimited with the number of ground parts used.