question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Cant remove tag in Runtime

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ribeiroferreiralucascommented, Jan 22, 2020

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?

0reactions
AdamRambergcommented, Jan 23, 2020

@lucasrferreira v2.1.1 just got released and includes the changes in this PR 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found