How to fix beam flickering when changing the texture?

I’m sorry if this is a dumb question, I have a feeling there is no solution.
The title is the question. How do i fix this?


If i cant fix it, i would like some ideas for workarounds (maybe have multiple different models of the character with different sprites and switch them out?)

2 Likes

You should use ContentProvider:PreloadAsync() on all the textures that will go on the beam, as otherwise they will only be loaded when they are needed.

2 Likes

I’m so sorry, am I doing this correctly? I’ve never heard of this
It’s only loading the Animation i have inside the script, none of the decals
image
image

it also doesnt read the rest of the script pass it, so the event doesnt start
image

1 Like

That seems ok. Just know that the callback isn’t required, you can simply only pass in the table of assets.
As for the assets not existing yet, try doing game.Loaded:Wait(), or wait for each individual asset before preloading them:

local angry = script:WaitForChild("Angry")
local explain = script:WaitForChild("Explain")
local think = script:WaitForChild("Think")

ContentProvider:PreloadAsync({angry,explain,think})

P.S. This is how every game does their loading screen, they just preload every single asset (specifically images and meshes) to make sure that gameplay appears smooth.

game.Loaded:Wait() doesn’t work in server scripts (at least they didnt for me), but I have a local script that fires an event to the server whenever the first player is loaded and the server can start doing stuff
I already have this in the beginning of my script

repeat
	task.wait()
until game:GetService("ReplicatedStorage").GameLoaded.OnServerEvent

Oh, if this is in a server script, you’ll want to move the preloading to the client. In this case, you’ll definitely want to use a loading screen.

1 Like

Thanks so much! I’ll look into making a loading screen. Ur the best!! <3<3<3

1 Like

Quick question, is it possible to preload assets owned by a group? I want to load every file my group has without having to manually input them all. I cant find a post on this
Some assets i use are stored as a string inside the script instead of as an existing decal

Unfortunately no. You can only preload assets/IDs by passing them in directly, and realistically you’ll only have to use what you already have in the game.
There’s probably a very complex way of doing this using HTTPService but I don’t think it’s worth that much effort.

1 Like

Dang, they should add that though. Saves people who made my mistake a lot of time. Unless i’m the only person who didn’t know about this and im making myself look like a fool (old man yells at cloud)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.