#check all parts is visible in a folder
1 messages · Page 1 of 1 (latest)
runservice definitely, you should never use while loop unless it's some simple array checking or something like that, AND inside a coroutine
only use .heartbeat, renderstepped only if it's about physics
ah ok
thanks
so like this right?
why?
yeah, but if the "PlankSpotsFolder" doesnt change, declare it before the runservice, and use events to check if objects were added/removd
i thought heartbeat isn't framerate based?
barely, it can lag if there are 50+ parts inside the folder, with the caching method i said even 100 parts will barely drop performance
ah ok
it has "deltaTime" has a parameter
i think i should just use runservice and not events because after all parts are visible i want to print a message and then disconnect the heartbeat connection
you have to do it once?
wdym
you have to do this "check" only once?
yes
then why using a loop??
because
do you know break in? like that plank system
uhm no tbh
im using runservice to check if all parts are visible, and if it is, then i print a message and then break it
icant check it once
because it starts as invisible
so you want to check it only when something happens? like when players enter the game or something? then use events
ok
when the player is finished putting all the planks (turning all parts visible)
also i hate to say this but you really shouldn't even worry about performance, you'll hardly get a laggy game with that simple system, but in the future hell you will
probably just save the data inside the player or something
im just focusing on the gameplay first, ill worry about performance later
aight thanks
alr, but just so you know, it'll be harder to optimize it later. and you should 100% do this asap if you plan on players from mobile to play (which i remember are like 80% of roblox)
aight
i'd keep note of that
np gl with your game