@Uncle Sam: I don't know why they wouldn't rotate on the y-axis, but anyway this the code I am using except it's simplified a bit, but it works fine.
`*****************************************************************************************************************
`Movement of tank model (Just wanted to show you how I'm doing it since you can't actually yrotate the tank since
` I'm rotating it back to 0, 0, 0 degrees each loop for the terrain angle code).
`*****************************************************************************************************************
PosX# = object position x(Tank)
PosZ# = object position z(Tank)
NewX# = newxvalue(PosX#, limb angle y(Tank, 1), TankSpeed) `<< Objects first limb is all limbs together, so in effect
NewZ# = newzvalue(PosZ#, limb angle y(Tank, 1), TankSpeed) ` limb angle y(Object, 1) can almost be used the same
position object Tank, NewX#, object position y(Tank), NewZ# ` way objecy angle y(Object) can be.
`*****************************************************************************************************************
`Angle of Tank model according to terrain
`*****************************************************************************************************************
`Reset anglefinder position on every loop
rotate object AngleFinder, 0, 0, 0
position object AngleFinder, object position x(Tank), object position y(Tank), object position z(Tank)
turn object right AngleFinder, object angle y(Tank)
`Get height of tanks front
move object Anglefinder, -3 `<< -3 is disance from middle of tank to front
FrontY# get terrain ground height(Terrain_Model, object position x(AngleFinder), object position z(AngleFinder))
`Now get the height of back of tank
move object AngleFinder, 6 `<< 6 because we need to move to back of tank
BackY# = get terrain ground height(Terrain_Model, object position x(AngleFinder), object position z(AngleFinder))
`First setup AngleFinder and then get right side height
position object AngleFinder, object position x(Tank), object position y(Tank), object position z(Tank)
turn object left Anglefinder, 90
move object Anglefinder, 1.6 `<< Distance from middle to right side of tank
RightY#=get terrain Ground Height(Terrain_Model,object position x(AngleFinder), object position z(AngleFinder))
`Finally get height of right side
move object Anglefinder, -3.2 `<< Distance from left side to left side
LeftY#=get terrain Ground Height(Terrain_Model,object position x(AngleFinder), object position z(AngleFinder))
`Finally put these variables into effect
PitchAngle# = 90 - atanfull(6, FrontY# - BackY#)
RollAngle# = 90 - atanfull(3.2, RightY# - LeftY#)
rotate object Tank, 0, 0, 0 `<< Makes sure the tank doesn't continuesly spin
pitch object up Tank, -PitchAngle#
roll object right Tank, -RollAngle#
If you have any questions then I will do my best to answer them.
There are 10 types of people, people who know binary and people who don't!