Announcement

Collapse
No announcement yet.

Elegant method to implement "CleanUp" function over a network

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

    Elegant method to implement "CleanUp" function over a network

    I have a NetMulticast function for doing cleanup (Removing Particle Effects etc) so I destroy the actor somthing like this
    Code:
    void CustomDestroy()
    {
       MutlticastCleanup();
       Destroy();
    }
    The issue is that because the actor is destroyed the multicast function doesn't get called on any of the clients (commenting out the destroy function and it works). I thought about calling Destroy() on a timer after some arbitrary "enough" time for the multicast function to get called but this feels very inelegant and hacky.

    Any suggestions?

    #2
    If the Actor is Replicated and you call Destroy on the server it will also call Destroy on the Client eventually so you don't really need any Multicast. Cleanup is exactly what the Destroy Event is for, it should never call any latent functions on the Actor that is being destroyed.
    Last edited by GarnerP57; 12-20-2019, 02:44 PM.

    Comment


      #3
      Thank you I will look into finding the Destroy Event.

      Originally posted by GarnerP57 View Post
      it should never call any latent functions on the Actor that is being destroyed.
      Sorry please could you explain what you mean by latent functions. Cheers.


      Comment


        #4
        A function that isn't called in the same frame (tick)
        Last edited by GarnerP57; 12-21-2019, 09:03 AM.

        Comment

        Working...
        X