Hey, I'm trying to use dark physics in a terrain generator I made, nothing serious, just realized I had it installed and wanted to do something with it
But basically, I'm having problems creating rigid bodies. The terrain objects are made using memblocks And I'm trying to use the command "phy make rigid body static mesh obj_no" to make them rigid bodies, but when I run the command "phy get rigid body exist(obj_no)" directly after, It's returning 0. The weird thing is, even though it always returns 0, the first object seems to work fine (I added a dynamic sphere + set it up to control with wasd, the collision is fine with the first chunk(object that makes up the terrain), but I fall through the rest)
On another (slightly unrelated) note, the collision is not working very well at all, well, It works fine but the dynamic sphere always seems to be sunk into the terrain.
any help??
here is the code (it's nested inside 2 for..next loops if it makes any difference)
make_object(obj_no,1,1,0)
phy make rigid body static mesh obj_no
if phy get rigid body exist(obj_no) = 0
if msgbox(":s","error","MB_ICONINFO","MB_OK") = "ok" then nothing = 0
endif
inc obj_no
make_object function:
Function make_object(objnum,meshnum,memnum,imgnum)
make mesh from memblock meshnum,memnum
make object objnum,meshnum,imgnum
endfunction
and the code for the sphere thing :s
make object sphere size*size+1,20
position object size*size+1,50,100,50
phy make rigid body dynamic sphere size*size+1
phy set rigid body mass size*size+1,50000