Open andrew-peng-144 opened 3 years ago
Question: should this work with the handlerdef, or should it be entirely local within the function that calls the query?
Answer: probably work with handlerdef... but that means either
tried 3rd method
Prob doing 2nd method lol. 3rd is weird because it just repeats much of the collision code, and still calls the handler for it, meaning the handling of queries is in same file as handling 2 hitboxes, unclean...
So for 2nd method, with "active" flag, have a way to make a hitbox only active for 1 frame. Timeline should be like:
There will still be querying in the future but it will not use the handler. Instead it will just return all the physicscomponents touching the queried area. Then in the local code user can decide what do with the returned physicscomponents.
To do it for melee attacks: Have a initially inactive entity placed anywhere on the map. Then if melee happens, move the entity to next to the attacker, then set it active. Then set it inactive after some frames, usually 1.
a way to query any area in the world. i.e. a hitbox that only lasts 1 frame. useful for combat