Hi, I'm wishing to make like a marble run thingy for my little cousin. I've done most of it, but the problem is, when I make the object and add physics to it it doent work with the dynamic ball object I made. It just goes rigth through it. However when I use a static box, it works.
Here's my code:
`Down Straight Button
if sprite hit(mouseimg,downstraight) and mouseclick()
inc num
load object "MediaGameObjectsDown Straight.3ds",num
texture object num,1000
scale object num,10,10,10
position object num,0,0,0
`Place the object
place(0)
endif
endfunction
`Piece placing function
Function place(final)
ang#=0
`Start loop
do
`Move using arrowkeys - WS for up and down - [] for rotation
if upkey() then move object num,1
if downkey() then move object num,-1
if rightkey() then move object right num,1
if leftkey() then move object left num,1
if keystate(17) then move object up num,1
if keystate(31) then move object down num,1
if inkey$()="[" then turn object left num,3
if inkey$()="]" then turn object right num,3
if inkey$()="," then dec ang,3
if inkey$()="." then inc ang,3
`Set the camera to follow the object
set camera to follow object position x(num),object position y(num),object position z(num),ang,60,30,1,0
`If the return key is pressed exit the loop
if returnkey()
if final=1
`Setup the physics
phy make rigid body dynamic sphere num
exit
else
phy make rigid body static mesh num
exit
endif
endif
loop
endfunction
`Setup Ball Function
Function roll()
`Making and placing the ball or marble
inc num
make object sphere num,3
texture object num,1000
place(1)
`Start the loop and update it
do
phy update
set camera to follow object position x(num),object position y(num),object position z(num),ang,60,30,1,0
loop
endfunction