Detaching entity with widget projected to screen creates duplicate

Describe the bug:

When I have entity (in my case locator) with widget of type “World - Project to Screen” detached from its parent (both are located under Player) - it creates duplicate.

How do you cause this bug?

  • create locator1 under Player
  • create locator2 under locator1
  • add widget to locator2, make it “World - Project to Screen”
  • detach locator2 from locator in Init of script on locator1

It causes two widgets to be shown rather than one. One seems to belong to detached locator and another is the same, but seems to be not detached.

Here is example script that does detaching

local SF_Pointer = {}

-- Script properties are defined here
SF_Pointer.Properties = {
	-- Example property
	{name = "holder", type = "entity"},
}

--This function is called on the server when this entity is created
function SF_Pointer:Init()
	self.me = self:GetEntity()
	self.player = self.me:GetParent()
	self.holder = self.properties.holder
	self.player.onDestroy:Listen(self, "DestroyHolder")
	self.holder:Detach()
end

function SF_Pointer:DestroyHolder()
	self.holder:Destroy()
end

function SF_Pointer:LocalInit()
	self.me = self:GetEntity()
	self.player = self.me:GetParent()
	self.holder = self.properties.holder
end


function SF_Pointer:LocalOnTick()

	self.diff = Vector.New(100,100,100)
	self.holder:SetPosition(self.player:GetPosition() + self.diff)
end

return SF_Pointer

If you place it on first locator and select second locator for “holder” property - the bug should reproduce.

Screenshots / video of bug:

Which platform: Stadia

Which input: keyboard + mouse

Your Crayta username: strowk

Game seen in (including “Hub” or “Editor for XYZ”): Editor of Spellfire / preview

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible): always

Version number (found in Help tab in Settings): 0.e3.63.114111

Just a note: I realize that I can workaround this by making template and spawning the second locator from there rather than detaching from the player, but this requires some additional work done and still does not change the fact that this is a bug and there does not seem to be any reason for second widget to be shown after detaching…