Homing missile
Blitz3D Forums/Blitz3D Programming/Homing missile
| ||
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 |
| ||
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. |
| ||
ah thanks, sorry for the double post, dunno how that came there |
| ||
Blimey, DeltaPitch and DeltaYaw? I've never heard of them! Brilliant... When are we going to get a documentation update? |
| ||
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. |