When comparing lists in c# it is done so by reference and not the values it contains. The values to not matter, and the comparison is comparing if the two lists are the same object reference. Thus your setup is not really correct 🙂
To check if a lists contains some element, you will need to use the “List Contains Element” condition. It is still tricky though because even the elements within are compared by reference if your elements (Command)Â are a “class” and by value only if they are a “struct”.
Thus is your Command is a struct, you will have to:
Store the list in a variable (Get Field).
Use the List Contains Element condition, targeting that stored list.
If your Command is a class, then it really gets far more complex and in that case a custom condition would probably be much better in that case.
Let me know if that works for you.
Thanks.
(PS: Please remember to post NodeCanvas questions in the NodeCanvas forums 🙂 )
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.