Ok I have given up on using the PostRenderFor function as it was never called. I decided to use my own function called from the my Pawn class that tells the Target its canvas so it can draw on it. However im getting some strange errors
Pawn:
Code:
simulated function Tick(float DeltaTime)
{
UTSDGame(WorldInfo.Game).TarA.PostRenderTarget(UTPlayerController(Controller).myHud.Canvas);
super.Tick(DeltaTime);
}
I have my target stored as a variable in the game class so i can reference it, then I call the Controller, then the Controller's HUD, then the HUD's Canvas. However I get Accessed None 'Controller' Error in my Log which seems impossible as I would not be able to move in game right? It seems very strange...
Here is my function in the Target if it helps
Code:
simulated event PostRenderTarget(Canvas Canvas)
{
Canvas.SetPos(Location.X, Location.Y);
Canvas.DrawText(TargetString);
`log("I Post Rendered!");
}
I want it to draw the words Target A at the location of the Target.
Can anybody shed some light on this?
EDIT: Alright I found out that the Controller only exists after the game begins (silly me
) however I now get an Accessed None 'Canvas' error.
Does the Canvas not exist in Deathmatch games?