Hello!
In my tank game, I create "holes" when a bullet hits the ground, sort like Counter-Strike when you use HE Grenades. Well, I can align my tank to the matrix, but I can't align the "hole"!. By the way I'm using a bit of code of the Limit Rush tutorial (a very good tutorial and game indeed!!

) to align my tank....¿why it doesn't work for my "hole" object?
Oh!, and..I've learned to use the Code Snippet button!!!

hahaha
Well, here's my "hole creation" function:
Function MakeScorch(x#,z#)
for t=0 to 90
if object exist(t+1800)=0 then u=t : exit
next t
Make object plain u+1800,8,8
Texture object u+1800,1005
set object u+1800,1,0,1,1,0,0,1
position object u+1800,x#,get ground height(1,x#,z#)+0.05,z#
id=u+1800
xPos#=x#
yPos#=get ground height(1,x#,z#)+0.02
zPos#=z#
yAng#=0
`------------------------------
`tilt the vehicle to the ground
`------------------------------
distVal#=1
`work out the positions of the front, back, left and right of the vehicle
ang#=yAng#
frontX#=newxvalue(xPos#,ang#,distVal#)
frontZ#=newzvalue(zPos#,ang#,distVal#)
ang#=yAng#+180
backX#=newxvalue(xPos#,ang#,distVal#)
backZ#=newzvalue(zPos#,ang#,distVal#)
ang#=yAng#+90
leftX#=newxvalue(xPos#,ang#,distVal#)
leftZ#=newzvalue(zPos#,ang#,distVal#)
ang#=yAng#-90
rightX#=newxvalue(xPos#,ang#,distVal#)
rightZ#=newzvalue(zPos#,ang#,distVal#)
`work out the different heights
frontHeight#=get ground height(1,frontX#,frontZ#)
backHeight#=get ground height(1,backX#,backZ#)
leftHeight#=get ground height(1,leftX#,leftZ#)
rightHeight#=get ground height(1,rightX#,rightZ#)
`Work out tilt values
xAng#=wrapvalue((backHeight#-frontHeight#)*30)
zAng#=wrapvalue((leftHeight#-rightHeight#)*30)
rotate object id,xAng#,0,zAng#
EndFunction
For some reason it doesn't rotate the object correctly..¿what's going on?
Bye, thanks in advance
I'm a newbie
