[Bug] Cant remove tag in Runtime
See original GitHub issueThe following code doesnt work.
AtomTags atomTags = GetComponent<AtomTags>();
atomTags.RemoveTag(TagToRemove.Value);
Tested in 2.0.0 and 2.1.0
[EDIT] I think I found the error. On “RemoveTag” function, is tested if tag is in Dict, but it return if true and not if false.
/// <summary>
/// Remove a tag from this `GameObject`.
/// </summary>
/// <param name="tag">The tag to remove as a `string`</param>
public void RemoveTag(string tag)
{
if (tag == null) return;
if (_sortedTags.ContainsKey(tag)) return; \\ <<<<<<---- HERE
_sortedTags.Remove(tag);
Tags = new ReadOnlyList<StringConstant>(_sortedTags.Values);
// Update static accessors:
if (!TaggedGameObjects.ContainsKey(tag)) return; // this should never happen
TaggedGameObjects[tag].Remove(this.gameObject);
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Cannot delete tags : r/Unity3D
I am tracking an issue where I thought materials are not being set at runtime, yesterday, turns out the objects are having their...
Read more >Bug - Removing NetworkBehaviour in runtime
Hello. I have PlayerMovement.cs script using Unity.Netcode; using UnityEngine; [RequireComponent(typeof(CharacterController))] public class.
Read more >Cannot remove tags - Microsoft Community Hub
I have a few tags appearing Microsoft Defender Security Center. I cannot remove them either in the UI or using the Add/Remove tag...
Read more >angular - Runtime Error this.object.remove is not a function
In my Ionic app, I can't delete specific key, it keeps telling me that remove is not a function. It seems there are...
Read more >Adding tags in code and removing assets issue
Hi! The following issue has been troubling me for quite some time. Check this script: var asset = this.app.assets.find('background'); ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Created PR: https://github.com/AdamRamberg/unity-atoms/pull/102
I had fixed the tests to.
[edit] I have a project current in development using that module. Will you release a new version with that fix soon?
@lucasrferreira v2.1.1 just got released and includes the changes in this PR 😃