Hi,
I've come up with a solution for detecting when the oil rig crate is being hacked, and wondered if anyone else had any ideas that might work better than mine?
It's simply this:
void OnCrateHack(HackableLockedCrate crate)
{
Vector3 cratePos = crate.transform.position;
if (Vector3Ex.Distance2D(CH47LandingZone.GetClosest(cratePos), cratePos) < 50f)
Puts("Oil rig crate being hacked");
}It calculates the distance from the crate to the helipad landing zone, if it is less than 50 then it's a crate that's on the oil rig being hacked. Or at least almost always likely.
Distances from oil rig crates to landing zones:
Small oil rig: 11.69496f
Large oil rig: 41.63598f
The distance to the bottom of each oil rig is about 45f.
This is a pretty solid way to determine if it is the oil rig crate being hacked as I couldn't find any way to specifically identify the crate.
Does anyone have anything better than this? If not I'll just go with it.