Heavensrevenger 1 Posted December 28, 2023 Hey I want to make the C-RAM bullets explode if they fly past the target. I know how I'll do the Code but I don't know how to get the object that the C-RAM is currently shooting at. Any help is appreciated! Share this post Link to post Share on other sites
mrcurry 505 Posted January 1 On 12/28/2023 at 4:54 PM, Heavensrevenger said: Hey I want to make the C-RAM bullets explode if they fly past the target. I know how I'll do the Code but I don't know how to get the object that the C-RAM is currently shooting at. Any help is appreciated! Best bet AFAIK is probably looking at targets and aimedAtTarget. Methodology: 1. Filter targets result for known and up to date objects 2. If only one is found you're set, otherwise continue. 3. Loop over the filtered result and check with aimedAtTarget if any return 1 and pick that as your target If in step 3 aimedAtTarget always equals 0 you can instead use the dot product between shooter's weaponDirection and vectorNormalized ( _targetPosASL vectorDiff _shooterPosASL ). The dot product will give you a value -1 to 1 of how aligned two vectors are, or in your case how "on target" you are, pick the target with the largest dot product and you should be good. Share this post Link to post Share on other sites
Heavensrevenger 1 Posted January 3 Ah nice, thank you that should do. I assume the praetorians aim will always be close to 1 for the intended target. Share this post Link to post Share on other sites