A while back I made a functioning speedkart edit where they all had the gravity jeep ability to climb walls and ceilings. I thought it'd be fun to demo that again today, but it seems to have broken over time. They behave just like regular speedkarts now with no gravity affect. Anyone see how this could be fixed?
function shiftgravitycheck(%obj)
{
if(!%obj.isshiftinggravity)
return;
%pos=%obj.getposition();
%ray=containerraycast(%pos,vectoradd(%pos,vectorscale(%obj.getupvector(),"-4 -4 -4")),$GravityJeepTypemasks,%obj);
%normal=getwords(%ray,4,6);
if(%normal!$="")
%obj.grav=vectorscale(%normal,"-0.5 -0.5 -0.5");
%obj.setvelocity(vectoradd(%obj.getvelocity(),vectoradd("0 0 0.5",%obj.grav)));
schedule(25,0,shiftgravitycheck,%obj);
}