#Performance issues

1 messages · Page 1 of 1 (latest)

velvet zephyr
#

Im currently making an escape for brainrots type game to build my developing experience. Instead of spawning in waves, i spawn in a row of a specific vehicle models that go towards the spawn and then gets destroyed when it reaches it. I have made these models myself in studio.

Every row is grouped as one model (there are 16 vehicle models alltogether in this). Every vehicle model has four wheel models inside (with 3 mesh parts in each), one union (which is the whole vehicle), and one plate part with surfaceGui and textlabel inside.

When i use my spawn script with this row model, the game gets more laggy, but it works fine if i just use a long block instead - so im guessing it's too many parts or something like that, even tho i've tried making the models have as few parts as possible. I'd just like advice on how i can make it not lag. Can it have to do with my scripts or do i just have to have models with even less parts?

I'll leave a picture of my spawning function and the function that moves the models (i can show more of my script if needed). All help is appreciated.

stray frigate
#

if this is like that yt shorts brainrot tsunami thing but with cars, just tween their positions to where you want

deep gull
#

(make them one part)

#

or are they meshes

velvet zephyr
velvet zephyr
#

i've unioned everything i can

stray frigate
velvet zephyr
#

Okay nice, i'll give it a try and see if that fixes it, thanks 🙂

deep gull
#

wait

#

i have an idea

stray frigate
#

If you want to improve performance a little more you could ditch the unioning, weld every part of the cars to one main part, and just tween that part

deep gull
#

make a single part that moves

#

and weld the other parts to it

#

then tween the cframe

#

of the one part

velvet zephyr
#

haha

stray frigate
#

on gah

velvet zephyr
#

Just to understand a little better, how is welding them more performant than unioning?

deep gull
#

cuz

#

it uses physics

#

every time u update a parts CFrame the welded parts move with it

#

Position/Orientation don't do that tho

#

its just more optimized dont blame me

#

you could have like 1000 welds and its more optimized

stray frigate
#

yep unioning the parts doesnt reduce the server 'cost' of moving all of them

deep gull
#

idk why ud need 1000 parts tho

deep gull
stray frigate
#

way less expensive to move 1 part

deep gull
#

the server auto moves the rest its like moving your hands

#

you dont think u just do

velvet zephyr
#

oh wow okay. I'll try welding instead then and moving with tween service, and hopefully it'll fix the issue

little folioBOT
#

studio** You are now Level 1! **studio

deep gull
#

remember

velvet zephyr
#

Thanks for the help, both of you 🙂

deep gull
#

tween the CFRAME

#

not the position

stray frigate
#

he's not rotating it

deep gull
#

u can test it

#

idk why its really dumb they only update with cframe

stray frigate
#

good to know

deep gull
#

yeah

#

i made that mistake one too many times and got sick of it 😭

stray frigate
#

@velvet zephyr btw the welded parts wont move if theyre anchored

#

only anchor the part everything is welded to

velvet zephyr
#

Will do 👍

#

One question.. Should/Do i need to ununion the unions and ungroup the models or can they stay as is?

deep gull
#

doesn't matter as long as u weld and unanchor them all

#

only anchor the single part

velvet zephyr
#

Alright

austere dock
#

ai skidder

#

fs

snow linden
#

tween the hitbox on server and model on client

#

and make a class for it ,better organised

deep gull
#

I'm this case

#

I'm going to kill whoever made autocorrect

#

IN.

stray frigate
stray frigate
velvet zephyr
#

I managed to make the position changes with a tween instead now. I tried to also run the tween on the client for smoother visuals - but it didn't really turn out great.. The models just get very out of sync, so they are in different places on the server and client.

#

Don't know if you guys have any tips on this, or if you think i even need the tween client-side or not?