Tag Info

New answers tagged


Your implementation is a bit off of the other Entity-Component systems I've seen. I recommend taking a look at EntityX. It should give a good idea of what a working implementation looks like. You could also read these which may help: Role of systems in entity systems architecture Component - Game Programming Patterns Understanding ...


ECS doesn't make miracles and not all the problems should be solved by it. In some point you will need especific code about the specific logic of your game. You can put an "Invulnerable" flag inside your health component and a flag "PenetrateInvulnerability" inside the atack message and your system combat manage then.


I eliminated the script's start function and just called the components in the update function. var bc = blueCube.GetComponent<PlayerMovementScript>(); var rc = redCube.GetComponent<PlayerMovementScript>(); if (Input.GetButton ("Switch")) { bc.enabled = !bc.enabled; rc.enabled = !rc.enabled;


As you said it was working fine, i found this thing different than other inside Update function: bc.enabled = !bc.isActiveAndEnabled; Is this logic should works on isActiveAndEnabled instead of enabled ?


It's OK to have component dependencies. And the more explicit the dependency the better. There's nothing worse than dependencies hidden behind useless layers of indirections. Your case doesn't look like a dependency hell to me. No circular dependency or unclear ownership of data: consider yourself lucky! Now I still believe that you need to reverse your ...


In my experiences there aren't too many ways around the fact that, you're right, all your different game entities and their components need to be aware of the state of the game and their own state. It's a mess unless you design with state machines in mind. The best way I've found to deal with it is to make sure that components are all doing small pieces of ...

Top 50 recent answers are included