Turning To Face Objects

Blitz3D Forums/Blitz3D Programming/Turning To Face Objects

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Try this ...

Function align( Entity, Target, Smooth# )

	dp# = LIMIT ( DeltaPitch( Entity , Target ) , -Smooth , Smooth )
	dy# = LIMIT ( DeltaYaw( Entity , Target ), -Smooth , Smooth )
	TurnEntity Entity, dp , dy , 0

End Function

;===========================
;===========================
;===========================

Function LIMIT#( q# , low# , hi# )

	If q < low q = low
	If q > hi q = hi
	Return q
	
End Function



Just call this ...

align( ONEpivot, ONEBATmesh, ONEtorque )