Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Best way to handle weapon

Discussion in 'Entity Component System' started by itsonh2610, Jan 12, 2020.

  1. itsonh2610

    itsonh2610

    Joined:
    Jul 15, 2017
    Posts:
    9
    Im a newbie in ECS. I wanna ask the best way to request multiple weapons shooting.
    - i have a Entity A(Character) contain DynamicBuffer<WeapoBuffer (intclude Entity)> when start request shooting i have to add a Component WeaponUse in Weapon Entity => wait to next frame to use another system chunk Weapon and WeaponUse to active and do the samething with Weapon request to attachments => i have to wait 2-3 frame to spawn bullets.
    -Or another way i have a Entity A(Character) contain DynamicBuffer<WeapoBuffer (intclude Weapon)> just change the bool in Component Weapon then next system in same frame check the bool var to active weapon and do the samething with attachments.
    -So the which one the best way to do?