Closed anicalbano closed 1 week ago
The shooting range is working, the advance shooting range still has issues
We fixed the raycast issues, but there is still an issue with the Advance range and the bullet hole decals not disappearing. I updated the ticket with the relevant info.
Decal won't disappear because it contains 2 Entities, only parent Entity would be deleted, but child Entity stays in the world by this logic:
`
[Query]
[All(typeof(SDKTransform), typeof(TransformComponent), typeof(DeleteEntityIntention))]
private void OrphanChildrenOfDeletedEntity(ref TransformComponent transformComponentToBeDeleted)
{
foreach (EntityReference childEntity in transformComponentToBeDeleted.Children)
{
SetNewChild(ref World.Get
transformComponentToBeDeleted.Children.Clear();
} `
Previous renderer cleans entities recursively:
void CleanUpEntityRecursively(IDCLEntity entity, bool removeImmediatelyFromEntitiesList)
{
using (var iterator = entity.children.GetEnumerator())
{
while (iterator.MoveNext()) { CleanUpEntityRecursively(iterator.Current.Value, removeImmediatelyFromEntitiesList); }
}
OnEntityRemoved?.Invoke(entity);
if (Environment.i.world.sceneBoundsChecker.enabled)
{
entity.OnShapeUpdated -= OnEntityShapeUpdated;
Environment.i.world.sceneBoundsChecker.RemoveEntity(entity, removeIfPersistent: true, resetState: true);
}
if (removeImmediatelyFromEntitiesList)
{
// Every entity ends up being removed through here
entity.Cleanup();
entities.Remove(entity.entityId);
}
else { Environment.i.platform.parcelScenesCleaner.MarkForCleanup(entity); }
}
Pending comments from @nearnshaw
Explorer Alpha build version:
0.3.402-g7a23dc7e-main
Issue Description:
When going to the position (83,-3) or (83,-1) we should be able to play on the practice shooting range, and interact with the targets. The normal shooting range is working correctly, but the Advance Shooting Range still has an issue, namely:
Evidence:
https://github.com/decentraland/unity-explorer/assets/56565104/f93cf1e7-217e-48b7-9ad5-85ea8af08839