PointEntity function

Blitz3D Forums/Blitz3D Programming/PointEntity function

Naughty Alien(Posted 2007) [#1]
..well, I need function with similar effect as PointEntity, except, i dont want instant facing of the entity to its target, but controlable smoth turning...anyone holding such a function on HD and willing to share??


Subirenihil(Posted 2007) [#2]
This only works around the Y axis, can be modified to work in any circumstance.
maxturn=10

entang#=DeltaYaw#(entity,target)

If Abs(entang#)>maxturn
	TurnEntity entity,0,maxturn*Sgn(entang#),0
Else
	PointEntity entity,target
EndIf



Matty(Posted 2007) [#3]
vecx#=entityx(targetentity,true)-entityx(entity,true)
vecy#=entityy(targetentity,true)-entityy(entity,true)
vecz#=entityz(targetentity,true)-entityz(entity,true)
Rate#=;some value between 0 and 1 with 1 being a snap transition, and a value lower than 1 being gradual

aligntovector entity,vecx#,vecy#,vecz#,3,Rate#
;3 = z axis, ie align the forwards axis of the entity to the vector from entity to targetentity at a gradual rate