Homing missile

Blitz3D Forums/Blitz3D Programming/Homing missile

HNPhan(Posted 2003) [#1]
I used to be able to get my missile to home into a target, but somehow it doesnt work anymore, dunno what i changed that made it not work anymore but anyway, heres how i did it:

i create the missile with a pivot not parented to the missile, it is then repositioned every cycle to the missile.
the pivot then points to the target and i use:
turnentity missile,entitypitch#(pivot,1)/25,entityyaw#(pivot,1)/25,entityroll#(pivot,1)/25

and then move the missile along its Z axis. has anyone tried that method? i seem to have forgotten something


Stevie G(Posted 2003) [#2]
If you use deltayaw and deltapitch (assuming you don't really need to know the roll) then there is no need to have the separate pivot. The following should work.

where target is your target entity

turnentity missile, deltapitch(missile,target)/25,deltayaw(missile,target)/25,0


I understand that the two (undocumented) delta commands return values from -180 to 180.


HNPhan(Posted 2003) [#3]
ah thanks, sorry for the double post, dunno how that came there


mrtricks(Posted 2003) [#4]
Blimey, DeltaPitch and DeltaYaw? I've never heard of them! Brilliant... When are we going to get a documentation update?


LostCargo(Posted 2003) [#5]
Oh man. i was coding something like this in blitz code. im glad to see that there is a native way to do this

Thanks for the post. This helped me too.