You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I am trying to make my flag tween down when a player steps on it.
What is the issue? Include screenshots / videos if possible!
I get no errors but the flag does not move at all. I checked the call script and the function is exactly the same name and I even put a print statement that prints out fine inside the function but it is not tweening.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried many discords but nobody is finding anything.
Module Code
local FlagService = {}
local Table = {
__index = FlagService
}
local TweenService = game:GetService("TweenService")
local FlagPositions = {
Down = {Flag1 = Vector3.new(-54.348, 103.035, 298.019)};
Up = {Flag1 = Vector3.new(-54.348, 120.375, 298.019)};
}
function FlagService.new(part)
local newFlag = {}
setmetatable(newFlag, Table)
newFlag.FlagPart = part
newFlag.DownTween = TweenService:Create(part, TweenInfo.new(10), {Position = FlagPositions.Down[part.Name]})
newFlag.UpTween = TweenService:Create(part, TweenInfo.new(10), {Position = FlagPositions.Up[part.Name]})
return newFlag
end
function FlagService:StartLower(waitUntilFinished)
self.DownTween:Play()
end
function FlagService:StartRaise(waitUntilFinished)
self.UpTween:Play()
end
function FlagService:PauseFlag()
self.DownTween:Pause()
self.UpTween:Pause()
end
function FlagService:ChangeIcon(player)
local content, isReady = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
repeat wait() until isReady
self.FlagPart.UI1.Frame.ImageLabel.Image = content
self.FlagPart.UI2.Frame.ImageLabel.Image = content
end
function FlagService:ChangeFlagVisibility(state)
self.FlagPart.UI1.Frame.ImageLabel.Visible = state
self.FlagPart.UI2.Frame.ImageLabel.Visible = state
end
return FlagService
well thats not the issue because like I said the functions prints fine and I used this OOP method before fine so its an iassue with the tween and not the OOP fucntionality
Okay, check your entire Workspace (in the explorer search bar) for welds. Studio is quite sneaky in the sense that it likes to create automatic welds to other parts without you realising. Delete all welds (except for the ones you want) and try again. Additionally, the flag is better off welded together with WeldConstraints than regular Welds. https://devforum.roblox.com/t/welds-not-working-with-tween/611989/4
Yah I just did that and it still doesnt work, however it does when create the tween directly inside the script instead of calling it from the module so I may need to not use a module
What is the position of the variable defined? I’m either assuming this references a Vector3 value or a part. If it is a Vector3, make sure that it is in the correct position, if it is a part then that’s the reason it doesn’t work.
A quick look at the hierarchy of the game would help a lot.