Changing TextureID's

Hello, I have a question about changing TextureID’s… What I am trying to achieve is to have the TextureID’s run through a loop, and change every 0.1 second. It will basically look like breaking Point’s Divine Knives. I know this might seem confusing but does anyone have any idea on how to do this?

get it

Did some (successful) experimenting with this type of stuff recently. Correct me if I’m wrong, but you want to have a bunch of premade texture frames playing like a video in a loop, right?

Parts apply whatever texture is a child to them. It follows then, that you need to parent and reparent your textures for every “frame” of the animation. This could be done by using tables. The way I’d do it is to set up your top-level table to be indexed, so it has frame 1, 2, 3, 4… so on at those indexes, and these table values would be tables themselves of the 6 face textures (which don’t need to be in any particular order really). Then you could simply loop through all the indexes, pausing for whatever your frame length is, parent the texture values of that index to the part, and then reparent the previous textures to some place (I’d use a folder in the knife to store all of the textures not in-use).

Edit: Changing the textureIDs themselves could work of course, but from experimenting with this method for a similar application, it caused flickering as the engine would have to re-render the new texture instead of just using a cached pre-loaded object (in the folder).

1 Like

If I had to guess, this is how they did it. The post comes with a place file that you can experiment with.

This is using offset UV values to show a simple translation, but the given example is more complex than just translating the texture and looks like it has individual animated frames.

1 Like