Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

HasComponent & GetComponentData problem

Discussion in 'Project Tiny' started by Seaqqull, Dec 10, 2020.

  1. Seaqqull

    Seaqqull

    Joined:
    Aug 3, 2018
    Posts:
    23
    Hello, I have an issue with getting new created and attached components to the [Entity].
    For example, I have an [Entity] - [Person], and it has several custom components: AttackAction, DieAction, TakingDamageAction, etc.
    But when I create a new component [WinAction], attach it to the same [Entity], and trying to get that component data (using [HasComponent] & [GetComponentData]) it shows me that there is actually no such component attached to the [Entity].
    *This [Entity] is never disabled and enabled.
     
  2. Sarkahn

    Sarkahn

    Joined:
    Jan 9, 2013
    Posts:
    437
    Can you show the actual code where the problem is happening and the error you're getting?
     
  3. Seaqqull

    Seaqqull

    Joined:
    Aug 3, 2018
    Posts:
    23
    In this code, inside of Stage = Win. I know that for sure that the entity has [WinActionComponent]. But it works as it hasn't
     

    Attached Files:

    • 1.png
      1.png
      File size:
      24.6 KB
      Views:
      47
unityunity