Whereas my code in playcanvas looks more like this:
if (currentEntity.script.SometimesMove) result = currentEntity.script.SometimesMove.canMove();
if (currentEntity.script.AlwaysMove ) result = currentEntity.script.AlwaysMove .canMove();
I am not sure how that solution would work with Script components?
I would like to keep the “movable” rules within components, and then attach the Component with the desired behaviour to the entity (in the editor)
In the case above, I would have a SometimesMove component and a AlwaysMove component, and then attach whichever one I wanted to a game entity (in the editor) - then any piece of code that wanted to check if the entity was movable would “just work”.