So my question, as posted as the topic title, is how I would get a raycast/hitscan bullet to delay it's explosion judging by the distance of the target.
As the projectile speed limit is 200, then the fastest that a bullet can travel 2000 brick studs is 10 seconds.
My question is if, supposing the Raycast scanning distance is unlimited, then can a function be written that detects distance, and gets the square root of it and multiplies it by a number less than it, approaching 0, that number sets the delay. So say if something is 2000 studs away and the raycast detects the distance,
it will fire with the function and divides by 3/10ths of the total distance (2000) and then sets the total value as the delay of the ray casting hit.Fixed, see figure below.It is figured as follows:Where:
T is the time of the delay.
d is the distance between the
muzzlePoint node and the target. (Measured in brick studs, in this case 2000 brick studs)
You could say that this is cheating the speed limit, but with the recent controversies over raycast/non-raycast snipers, I've decided to post this as a solution of trying to make weapons that are velocity-accurate. A working function of this objective would help weapon makers like myself make weapons of higher quality. As it does not disobey the projectile speed limit, it should not lag when fired and to my knowledge isn't impossible.
So tell me what you all think? Is this possible? Have any ideas on how this would be written?