View Single Post
  #4  
Unread 06-14-2018, 11:30 PM
Grimmerthan Grimmerthan is offline
The Indomitable
Interface Author - Click to view interfaces
 
Join Date: Aug 2014
Posts: 11
Ok, I isolated the behaviour and stripped it down to one line of code.

The EntityControl will maintain a target as expected, if :GetTarget() is called again, prior to LocalPlayer changing target.

The EntityControl loses the connection to the target the next time LocalPlayer changes target, with this call order:
Code:
        local Target = LocalUser:GetTarget()
        self.TargetSelection:SetEntity( Target )
It will maintain a connection, when this is done:
Code:
        self.TargetSelection:SetEntity( LocalUser:GetTarget() )
        local Target = LocalUser:GetTarget()
Neat

Last edited by Grimmerthan : 06-15-2018 at 09:13 AM.
Reply With Quote