So, i'm new to DB pro, and i'm trying to ues the collision part, personally, i prefer polygon collision, as long as there's not too many polygon detections to slow down the game...
The following code is used to make collision for my character (object 2)
load object "C:/Alien.x",2
set object cull 2,0
set object light 2,0
read chx#,chy#,chz#
chx#=512;
chy#=2;
chz#=512;
position object 2,chx#,chy#,chz#
set object collision to polygons 2;
yrotate object 2,0 : fix object pivot 1
The following is used for a square platform:
rem make object box 5,15,5,10
load object "C:/BOXBOX.x",5;
set object cull 5,0
set object light 5,0
position object 5,512,20,512
set object collision to polygons 5;
As u can see i have also tried to make the platform using the make object box function, but for now, i've just made it a remark.
The part that detects collision:
if (object collision(2,5))
Done=0;
position object 2, object position x(2), 20, object position z(2);
Zspeed#=0;
print "HEJSA!!!!!"
endif
Now the problem is, that no matter how i make the square, the collision detection, only seems to detec 1/4 of it... This will as usual be the 1/4, that's right-down, if you look on it from above, and this is both when importing the model, as well as using the
make object box function :S