So i’ve seen that the only way to get diferent trace results with surfaces it’s physical materials has anyone got any experience with them, tracing down the landscape and getting diferent result ?
function scanlandscape()
{
local vector loc, norm, end;
local TraceHitInfo hitInfo;
local Actor traceHit;
local PlayerController PC;
local UTPhysicalMaterialProperty PhysicalProperty;
PC = PlayerController(Seats[0].SeatPawn.Controller);
end = Location;
end.z = Location.z -100;
traceHit = trace(loc, norm, end, Location, true,, hitInfo);
///DrawDebugSphere(end,56,6,0,255,0,true);
PC.ClientMessage("");
//fuelmultiply =(carspeed * 0.001);
fuel = (fuel -(carrevs * 0.00001) ) * fuelmultiply;
if (traceHit == none)
{
PC.ClientMessage("Nothing found, try again.");
return;
}
PhysicalProperty = UTPhysicalMaterialProperty(HitInfo.PhysMaterial.GetPhysicalMaterialProperty(class'UTPhysicalMaterialProperty'));
//check the material type and change wheel particles
if (PhysicalProperty.MaterialType == 'Stone') ///track
{
bisinthesand=false;
bisongrass=false;
bisontrack=true;
UDKVehicleWheel(Wheels[2]).SteerFactor = 1.0; ///front wheel
UDKVehicleWheel(Wheels[3]).SteerFactor = 1.0; ///front wheel
UDKVehicleWheel(Wheels[0]).LatSlipFactor = 2.75;
UDKVehicleWheel(Wheels[1]).LatSlipFactor = 2.75;
UDKVehicleWheel(Wheels[2]).LatSlipFactor = 0.75;
UDKVehicleWheel(Wheels[3]).LatSlipFactor = 0.75;
}
}
original code from tegleg.
I have problema the code does not detect the landscape any idea on that ?
Oh my bad, i traced, like upside down i think is said, trace end and trace start in wrong params. LoL. Now it Works now ima try the phyisical material.
Awsome it Works! ! ! Bye bye collision cylinders and volumes everywhere in the map. Thanks !!
Problem, how do you assign physichal material property in the editor ??
Oh nvm i had to create a class physichal Material in the code.
no worries.open the landscape tool,in the target layer section hit edit.next to the texture thumbnail is where you enter the physmat.
Yep i got that.
Awsome i discovered that they work to on foliage actors.
pretty sure it works on any actor.