ParaScript.TargetCall

Declaration

public void TargetCall(string method, ParaPlayer target,Action onFinish, params object[] args)

Description

Makes a remote call to the specified function in the specified player’s script.

Parameter

methodName of the function defined in the Lua file of the ParaScript
targetTarget player that receives the call
onFinishCallback notification when a remote call is completed
argsVariable parameter
function RemoteMethodName(info,num)
  print("Recv call ",info,num);
  return "remote method retruned";
end

function OnNetSpawned()
    local objTarget = ParaPlayerService.GetPlayerById(1003);
    self:TargetCall("RemoteMethodName",objTarget,function(result)
       print(result);
    end,"hello",123);
end