Turning To Face Objects

Blitz3D Forums/Blitz3D Programming/Turning To Face Objects

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, 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 )