3d collision

I’m interested in creating a 3d game (why else did I make multiple 3d attempts)

Luckily, I have made a solid wall, & you can’t cross this wall from any side!

3d 11-11-2020_5-17-32PM.html (2.1 MB)

Please make suggestions of what to add next, or report any bugs you find, to get a free high five!

5 Likes

It is pretty extraordinary what you are able to accomplish with this.

1 Like

Do you think you can make the player jump? Also, when I walk sideways into the right/left wall, I can clip through it.

I also have a suggestion how to improve the wall collision. I think how you made the player stop at a wall is move the player back to where it was before it touched the wall. Unfortunately, this makes it so you can’t slide against a wall like you usually can. To fix this, depending on which side of the wall was touched, it only changes the X and Y of the player For example, if you touch the left or right side of a wall, it changes the X to where it was before while doing nothing with the Y value. And the converse happens for when you touch a top/bottom side of the wall.

1 Like

That’s not how I did the collision. I actually made some type of object that goes infront of the player. If that object hits a wall, it doesn’t let the player move at all. When the player tries to go in another direction, the object will point in that direction too, and if it touches nothing, it’ll allows the player to move that way. Now, if the player is moving diagonal, the object doesn’t seem to point diagonally to sense that there’s a wall in front of the player, which is why you got that bug. Thank you for finding it, it should be an ez fix!

:raised_hand: High five!

this is pretty interesting. although, you can easily do 2d collision and render it in 3d, making a 2.5d engine. when you add the third dimension though, i think this will go a long way.

Yeah, this is basically just 2D just shown as 3D, like raycasting. For third dimension collisions, you keep the code you did for the second dimension collision, then copy+paste the code for the Z axis, or for the ZX/ZY plane, depending on how you implemented the collisions. Speaking of collision implementations, how would anyone else go about making box-to-box collisions? When I do it I separate the X and the Y so they don’t interfere with each other.

Yes, my project is not fully 3d (I call it 3d b/c 3 dimensions are visible), it looks more like a 2.5d. I can probably take one of Baron’s engines, and give it a Z value… but it might lag more.

wick file?