I’m trying to make a text move onto the screen after you touch a certain part but i cant get the text to move onto the screen?
-Here’s The Script
finish = false
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
local playerGui = player:WaitForChild(“PlayerGui”)
local text = playerGui:WaitForChild(“WinnerText”)
local tweenService = game:GetService(“TweenService”)
local finishLine = workspace:WaitForChild(“FinishLine”)
local counter = playerGui:WaitForChild(“Counter”)
local function onTouched(hit)
if hit.Parent and not hit.Parent:FindFirstChild(“Humanoid”) then
return
end
local playerHit = Players:GetPlayerFromCharacter(hit.Parent)
if playerHit ~= player then
return
end
counter.Frame.Visible = false
counter.Frame2.Visible = false
counter.TextLabel.Visible = false
-- im focusing on this script right here⬇️
local goal = {}
goal.Position = Vector2.new({0.175, 0},{0.251, 0})
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine)
local tween = tweenService:Create(text, tweenInfo, goal)
end
I added your guys recommendations but i still get this error:
TweenService:Create no property named ‘Position’ for object ‘WinnerText’ - Client - LocalScript:28
finish = false
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
local playerGui = player:WaitForChild(“PlayerGui”)
local text = playerGui:WaitForChild(“WinnerText”)
local tweenService = game:GetService(“TweenService”)
local finishLine = workspace:WaitForChild(“FinishLine”)
local counter = playerGui:WaitForChild(“Counter”)
local function onTouched(hit)
if hit.Parent and not hit.Parent:FindFirstChild(“Humanoid”) then
return
end
local playerHit = Players:GetPlayerFromCharacter(hit.Parent)
if playerHit ~= player then
return
end
counter.Frame.Visible = false
counter.Frame2.Visible = false
counter.TextLabel.Visible = false
local goal = {}
goal.Position = UDim2.new({0.175, 0},0,{0.251, 0})
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine)
local tween = tweenService:Create(text, tweenInfo, goal)
might be the service itself since it was after a text variable were created, move them to the top of player service (there’s another thing wrong here for the text)
would be better to put it in StarterGui also ServerScriptService is for Server side only, localscript wont even work there
another wrong things ive mentioned and noticed is the way you put text in, since textlabels are 2D UI, you have to put those in the ScreenGUI to display and see the animations of text, putting them outside screengui doesn’t seem to work either.
What is winner text? A text label? A screengui?
Screen Guis don’t have a Position property, but act as a container for other GUI elements. If it’s anything else it may not render properly unless it is parented to a screen gui.