I am quite new to this coding in Unreal Script but i am getting there.
I have implemented the trace tutorial from the UDN website that will return a message to the HUD and also call up a texture when the trace hits a mesh/actor.
Please Help.
I need it to return the mesh objects name eg; farmhouse, stairs, wall, etc,.
and/or
I need to be able to say "if mesh/actor/object is "farmhouse" then show this texture"
please help!!!
I have implemented the trace tutorial from the UDN website that will return a message to the HUD and also call up a texture when the trace hits a mesh/actor.
Code:
class RTTestInteraction extends Interaction;
function Initialized()
{
log(self@"i'm alive");
}
function PostRender( canvas Canvas )
{
simpleTracer(Canvas);
}
function simpleTracer(canvas Canvas)
{
local actor Other;
local vector HitLocation, HitNormal, StartTrace, EndTrace;
local vector ScreenLocation;
local PlayerController PlayerOwner;
PlayerOwner = ViewportOwner.Actor;
//Perform a trace to find any colliding actors
StartTrace = PlayerOwner.Pawn.Location;
StartTrace.Z += PlayerOwner.Pawn.BaseEyeHeight;
EndTrace = StartTrace + vector(PlayerOwner.Pawn.Rotation) * 1000.0;
Other = PlayerOwner.Pawn.Trace(HitLocation, HitNormal, EndTrace, StartTrace,True);
if (Other != None)
{
PlayerOwner.ClientMessage ("Hit:"@Other);
//Convert 3d location to 2d for display on the Canvas
ScreenLocation = WorldToScreen(Other.location);
Canvas.SetPos(ScreenLocation.X, ScreenLocation.Y);
Canvas.Style = 3;
Canvas.SetDrawColor(255,255,255);
Canvas.DrawTile(texture 'S_Actor', 84,84,0,0,84,84);
}
}
defaultproperties
{
bVisible=true
bActive=true
}
Please Help.
I need it to return the mesh objects name eg; farmhouse, stairs, wall, etc,.
and/or
I need to be able to say "if mesh/actor/object is "farmhouse" then show this texture"
please help!!!