How do you deal with multiple calls of FindFirstChild(), WaitForChild(), etc?
I'm new to both Rojo and Roblox-ts. One thing I noticed is that when I'm trying to access children of Instances is I'm having to repeatedly use FindFirstChild or WaitForChild or other methods and then having to use type casting or checking if the instance exists before finding the next child and so on and so forth
Original luau code that looked like this:
Now looks like this
I find this approach very annoying and ugly but I could just be missing some simpler and more elegant way
Solution:Jump to solution
npm
@rbxts/validate-tree
Validates whether a given instance matches a given instance tree. Latest version: 2.0.2, last published: 3 years ago. Start using @rbxts/validate-tree in your project by running
npm i @rbxts/validate-tree
. There are 6 other projects in the npm registry using @rbxts/validate-tree.7 Replies
Often I'd use something like
validate-tree
Solution
npm
@rbxts/validate-tree
Validates whether a given instance matches a given instance tree. Latest version: 2.0.2, last published: 3 years ago. Start using @rbxts/validate-tree in your project by running
npm i @rbxts/validate-tree
. There are 6 other projects in the npm registry using @rbxts/validate-tree.There's something somewhere where in studio I can click on an instance and it will generate me the tree there, so I don't manually write it
There are other options on the market too, if you use Flamework for example: https://discord.com/channels/476080952636997633/1381337010387816598/1381346766166823084
Yeah I'm porting an existing game so I don't really have much flamework stuff rn
Indexing Children | roblox-ts
New roblox-ts users often ask, "How can I index a child in the game like game.Workspace.Zombie?"
Okay I found this which is the studio feature I think you're talking about
yup