Hello, new to dark basic 3d, and I am making a simple game. I have got to the stage, where you can look around the map with the mouse, and use WASD to move. Now I need to make it so you cant walk through walls and there is gravity.
I have tried placing this just before my game loop:
set global collision on
Automatic Camera Collision 0,5,1
This does nothing. The camera is above the floor, since I used
The tutorials seemed to have the autocam off command, so I tried it, but it did nothing. My map is small, inside, made with 3d World Studio. It is .dbo, but i could export as .x. None of them work. Please give some example code for collision.
My whole loop is below:
Do
//Show FPS
Text 10,10,"FPS: " + str$(screen fps())
Text 10,30,"Polygons: " + str$(statistic(1))
rotate camera camera angle x()+(mousemovey()/2),camera angle y()+(mousemovex()/2),0
if camera angle x()>90 then xrotate camera 90
if camera angle x()<-90 then xrotate camera -90
cx#=camera angle x() : cy#=camera angle y() : cz#=camera angle z()
if keystate(17)=1
move camera 10
endif
if keystate(31)=1
move camera -10
endif
if keystate(32)=1
xrotate camera 0: yrotate camera cy# + 90: move camera 10: xrotate camera cx#: yrotate camera cy#
endif
if keystate(30)=1
xrotate camera 0: yrotate camera cy# - 90: move camera 10: xrotate camera cx#: yrotate camera cy#
endif
Loop