Nevermind. I moved the hookDisable datablock elsewhere in the scripts and it stopped crashing.
I'm making a gravity-gun like carrying function (Like Portal's weighted cube carrying).
I probably have absolutely no idea what I'm doing here.
function pushModeProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%col.getClassName() $= "WheeledVehicle")
{
%pos1 = getWord(%pos, 0);
%pos2 = getWord(%pos, 1);
%pos3 = getWord(%pos, 2);
%pos1 = %pos1 + 0.5;
%pos2 = %pos2 + 0.5;
%pos3 = %pos3 + 0.5;
%col.setTransform(%pos1 SPC %pos2 SPC %pos3);
}
}
It does work, although only for a while before the crate bounces off completely (The pushMode weapon is rapidfire). It's quite buggy. Yes, I'm using vehicles for the crate physics.
Anyone think of a better way to do this?