#React to component enabled state changed.
1 messages · Page 1 of 1 (latest)
not without some complex solution
Do this complex solutions needs structural changes?
no, it'll involve adding state
either field in your comp
or separate comp
which tracks whether reaction happened or not
after state changed
which you'll have to manage on your own (aspect will help with this)
but then it will run every tick? the check
it is a tradeoff between a check every tick vs structural changes. Right?
yes
kind of
why do you need it in the first place?
why can't you just manage doing reaction during state change?
without involving this overcomplications
i have a spatial hashing system and i need to remove the entity from the spatial hash when it is disabled
(on my server, a MOB is disabled when it dies until it respawns)
Maybe this is the problem
How often changing state happens?
every time a mob die
My game can handle like 7500 players (i have tested on 12 core server and it works outputting nearly 1gbps of bandwidth)
And they will kill a lot of mobs
But i dont think a lot is a lot for structural changes. Im just avoiding it at all costs rn
i don`t want to bottleneck game server on main thread
like physics?
yep