Jecs Cleanup Attributes Help
I'm struggling to figure out how Jec's component traits work. I have a state machine like system that attaches a tag to an entity called "DoingATest".
I've setup a function that runs on startup to setup the cleanup:
And in my runtime I am removing the tag like so
basically when pathfinding failed tag is added it removes doing a test because it failed to do the test.
Here is a snip of my components:
I havent had issues getting OnRemove to work with other tags, is there anything I should check for in this case? Am I not understanding the purpoe of these hooks?
Thanks!
Side question: is there any documentation for creating custom traits?
29 Replies
Solved! I am using planck and I had it in a Phase.Startup system, moving it to directly in the components file fixed it. Not sure why
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
It ran the print statement so it did run just maybe not on the same world?
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
whats weird is i have another startup phase function for testing that works fine it just adds some entities to start
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
just Phase.Startup
import { Phase } from "@rbxts/planck";
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
I used the Planck setup guide basically copy-paste
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Jecs | Planck Scheduler
Suggested setup guide for Jecs
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
thats what mine is
each module should have
then when you require the module and add to table you must cast the type and require(module).default
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
So don’t make those calls inside Planck systems?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
So if I wanted to clean up other components if another component is removed on the same entity how would I do that?
It’s Phase.PostUpdate it’s in the types
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
What is my approach doing, thats incorrect? Sorry just trying to understand. Also clear would clear everything? Is that any different from calling remove individually
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
would a better approach be using :cached() and then clearing when changes happen
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
so if I wanted to remove components when another component is removed, what would be an appropriate way to do that?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
got it, thank you!
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Please make another support thread instead of using this thread, that way you can provide your environment and we can help