Texture Not Moving

So I’m currently trying to figure out why my texture doesn’t move. I tried editing this post to my needs for Textures instead of UI. The scripts and the arrangement are shown below. Thanks so much from John.

local movingtexture = script.Parent
local bgFr = Texture:WaitForChild("BackgroundFrame")
local fxFr = Texture:WaitForChild("EffectFrame")
local TS = game:GetService("TweenService")

function Tween(obj,prop,info) -- object to animate, properties to change, tween info.
  	info = info or TweenInfo.new(
		1,
		Enum.EasingStyle.Linear,
		Enum.EasingDirection.Out,
		-1,
		true,
		0
	)
	TS:Create(obj,info,prop):Play()
end

while true do
	fxFr.Position = UDim2.new(0.75,0,0.75,0) -- set position to bottom right
	Tween( fxFr,  { Position = UDim2.new(0.25, 0, 0.25, 0) } ) -- Tween to top left
	wait(1)
end
Arrangement

Edit: I know how to use GIFs are textures but tbh I don’t want them this would be easier.

1 Like

What are these?

If they’re frame than you can not have frame inside a texture and if they’re texture texture does not have a position property. What you can do is tween the offset of the texture.

1 Like

Idk, tbh I just changed the basics. What should they be?

Do you want to tween the current texture or have multiple?

1 Like

Hey there. Do you have a copy of the edited code?

Also, when you say “move the texture”, do you mean the past the texture is placed on to, or some element of the texture itself?

What is the effect you’re trying to create?

1 Like

Texture is not a gui
and I don’t know what the script actually above does to the texture, it’s not pointing at the texture to do something or anything

You can make a moving texture by Offset it, texture has the property named OffsetStudsV and OffsetStudsU and you can make a moving texture from it

So this script is for the main problem that texture doesn’t move

local texture = script.Parent

while true do
	texture.StudsPerTileV = 0
	texture.StudsPerTileU = 0
	game:GetService("TweenService"):Create(texture, TweenInfo.new(1, Enum.EasingStyle.Linear), {OffsetStudsV = texture.OffsetStudsV + texture.StudsPerTileV, OffsetStudsU = texture.OffsetStudsU + texture.StudsPerTileU}):Play()
	wait(1)
end

in this script, the tween will make the texture pass 1 tile and reset the offset, and repeat.
I reset the offset to avoid passing the max possible integer even idek if that would even happen or not :joy:

5 Likes