Timeline for How to detect collision of a wall with grid movement?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 4, 2015 at 1:56 | comment | added | JPtheK9 | Happy to help. If you need any more information or ideas, feel free to ask and I'll do my best :) | |
May 3, 2015 at 11:18 | comment | added | Martin Rohwedder | Thank you... I have tried coding my own grid manager, which has some tile objects witht he corresponding information I have to use. It seems to work, so therefore I am accepting your answer. Thanks for your help :) | |
May 3, 2015 at 11:18 | vote | accept | Martin Rohwedder | ||
Apr 27, 2015 at 17:22 | history | edited | JPtheK9 | CC BY-SA 3.0 |
added 340 characters in body
|
Apr 27, 2015 at 17:04 | comment | added | JPtheK9 | Note: GridMap can be a static class for better performance and GridNode can't inherit from MonoBehaviour or you're gonna get some huge overhead. GridPhysics can be static as well (like Unity's Physics class). GridAgent should be the only class inheriting from MB. | |
Apr 27, 2015 at 17:02 | comment | added | JPtheK9 | Oh, I see. This method might take a bit more work effort but it'll benefit you A LOT in the long run since grids can be used for many things. Create scripts called GripdMap, GridNode, GridAgent, and GridPhysics. Generate the 2D array of GridNodes in GridMap. GridNode should include a boolean called 'Occupied' but you can add other things as well. Attach 'GridAgent' on your player and use that to interact with the grid. Basically, GridAgent converts your world position into 2 integers on the XZ plane (just round it off). GridPhysics is for specialized things like gridcasting. | |
Apr 27, 2015 at 7:49 | comment | added | Martin Rohwedder | mhh.. I am not quite sure what you mean, I haven't made my level in an 2D array. The script I provided is attached to my player object, and it then moves 1 world unit (which is the same as a tile). How can I make use of a 2D array, for my level instead? Should I use the 2D array to generate the level also? | |
Apr 26, 2015 at 21:35 | history | edited | JPtheK9 | CC BY-SA 3.0 |
added 195 characters in body
|
Apr 26, 2015 at 21:29 | history | answered | JPtheK9 | CC BY-SA 3.0 |