clayisntdead
Member
Hello!
So I started playing around with GameMaker's 3D functions a few days ago and have been trying to build my own Minecraft clone (original, I know). I've had very few issues thus far, however now I'm stuck. I'm trying to build a system that allows the player to build/break blocks, just like in Minecraft, and I think I've come up with a good system for this, I just don't know how exactly to implement it into my game. Here's what I'm working with:
I have a 2D project that I'm using to test my building/breaking system (pictures below). In this 2D project, a line is drawn that starts at the player and goes on in the direction the player is facing until either 1) it hits a wall, or 2) it reaches it's max. distance (it's like a raycast). If a block is being touched by a raycast line, left click can destroy it and right click can place another block next to it (just like in Minecraft). Here is the project file for this test if you don't mind seeing exactly what I've done. I want to convert this system to my 3D game somehow, which I'm not really sure how to do. I have a basic understanding of how GameMaker's 3D functions work and how to build a game with them, however I just can't figure this out. I've tried adding a Z axis check to my 2D test project which seems to work, I mainly just don't know how I could add this system to the player controller in my 3D game. If someone could point me in the right direction I'd really appreciate it! I'm using GM:S 1.4.
Pics:
So I started playing around with GameMaker's 3D functions a few days ago and have been trying to build my own Minecraft clone (original, I know). I've had very few issues thus far, however now I'm stuck. I'm trying to build a system that allows the player to build/break blocks, just like in Minecraft, and I think I've come up with a good system for this, I just don't know how exactly to implement it into my game. Here's what I'm working with:
I have a 2D project that I'm using to test my building/breaking system (pictures below). In this 2D project, a line is drawn that starts at the player and goes on in the direction the player is facing until either 1) it hits a wall, or 2) it reaches it's max. distance (it's like a raycast). If a block is being touched by a raycast line, left click can destroy it and right click can place another block next to it (just like in Minecraft). Here is the project file for this test if you don't mind seeing exactly what I've done. I want to convert this system to my 3D game somehow, which I'm not really sure how to do. I have a basic understanding of how GameMaker's 3D functions work and how to build a game with them, however I just can't figure this out. I've tried adding a Z axis check to my 2D test project which seems to work, I mainly just don't know how I could add this system to the player controller in my 3D game. If someone could point me in the right direction I'd really appreciate it! I'm using GM:S 1.4.
Pics: