Announcement

Collapse
No announcement yet.

How to reference the current controller

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to reference the current controller

    What I am trying to do is increment the number of kills (score) for the current player. I've heard that you have to be able to reference the controller to do that.

    If anyone has done this or knows how to do this, please let me know.

    Thanks guys, i searched but couldn't find anything.

    #2
    It depends where you are calling it... what references already exist in the class and what parameters are passed to the function that is calling it.

    If you have a reference to the pawn (P) but not the controller, you can do something like:
    Code:
    if ( P.Controller != None && P.Controller.PlayerReplicationInfo != None)
    {
        P.Controller.PlayerReplicationInfo.Score += 1;
        P.Controller.PlayerReplicationInfo.NetUpdateTime = Level.Timeseconds - 1;
    }
    Find the best way to update the PRI for your situation.

    Comment

    Working...
    X