#check all parts is visible in a folder

1 messages · Page 1 of 1 (latest)

coarse valley
#

is it better to use a while loop or runservice.heartbeat to check if all parts are visible inside a folder?

shy imp
#

only use .heartbeat, renderstepped only if it's about physics

coarse valley
#

thanks

#

so like this right?

#

why?

shy imp
coarse valley
#

i thought heartbeat isn't framerate based?

shy imp
#

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

coarse valley
#

ah ok

shy imp
coarse valley
#

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

coarse valley
shy imp
coarse valley
#

yes

shy imp
#

then why using a loop??

coarse valley
#

do you know break in? like that plank system

shy imp
#

uhm no tbh

coarse valley
#

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

shy imp
#

so you want to check it only when something happens? like when players enter the game or something? then use events

coarse valley
#

ok

coarse valley
shy imp
#

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

shy imp
coarse valley
#

im just focusing on the gameplay first, ill worry about performance later

coarse valley
shy imp
coarse valley
#

i'd keep note of that

shy imp
coarse valley
#

thx

#

and gl with your projects (if you are working on one) too!