And this:
Image.Size = UDim.fromScale(workspace.Currency.Size.X, workspace.Currency.Size.Y)
And this:
Image.Size = UDim.fromScale(workspace.Currency.Size.X, workspace.Currency.Size.Y)
Edit: You shouldnât try to do this. It is easier to always use a certain number for the size of the currency than trying to figure it out with a code. If the currency is always 12 Studs X and 5 Studs Y long, then itâs better to play around with the Guis to get a good size as try to figure it out with a code.
Do you know how to make it hover and then go upward like the post did
Whatâs rotating? The gui/frame or the part?
I apologize, I corrected my post as i messed up on what I said.
Did I help you Or i not help you?
You helped a lot, im just curious how to make it go upward like the post did
Tween it.
local TweenService = game:GetService("TweenService")
local Tween = TweenService:Create(currencyPickup, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), { currencyPickup.Position = currencyLabel.Position })
Iâm aware thereâs a function for Gui elements, but this is far more versatile.
What is âcurrencyPickupâ? Is this the âPartâ just renamed?
No, itâs the element you create when you pick up the currency.
I am quiet confused, element? I am new to vector/tweening all that.
Sorry, Iâm using UI design terms. Basically an element is an imagelabel or textbutton. That kind of thing.
Ahh, I named that âImageâ so would I just replace it? Also the currencyPickup.Position is getting errored?
That is also that âimageâ variable. The currencylabel is that imagelabel for the currency. You shouldât have a problem if you tween it to there.
Am I doing this right???
local TweenService = game:GetService("TweenService") local Tween = TweenService:Create(Image, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), { Image.Position = player.PlayerGui.Profile.Frame.Cash.Position }) end)
This is my full code if needed
local player = game.Players.LocalPlayer local RE = game.ReplicatedStorage:WaitForChild("Send") RE.OnClientEvent:Connect(function() print("received") local camera = workspace.CurrentCamera local worldPoint = workspace.Part.Position local Vector = camera:WorldToScreenPoint(worldPoint) --locel Depth = Vector.Z local screenPoint = UDim2.fromOffset(Vector.X, Vector.Y) local ScreenGui = Instance.new("ScreenGui", player.PlayerGui) local Gui = Instance.new("Frame", ScreenGui) local Image = Instance.new("ImageLabel", Gui) --local vectorp = screenPoint.Position Gui.BackgroundTransparency = 1 Gui.Size = UDim2.new(0.086, 1, 0.061, 1) Image.Size = UDim2.new(0.675, 0, 1, 0) Image.Image = "http://www.roblox.com/asset/?id=8057767" Gui.AnchorPoint = Vector2.new(0.5, 0.5) Gui.Position = screenPoint Image.Position = 1,0,0,0 local TweenService = game:GetService("TweenService") local Tween = TweenService:Create(Image, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), { Image.Position = player.PlayerGui.Profile.Frame.Cash.Position }) end)
Seems right, not sure whatâs wrong. Mind telling me the error?
Iâve realized whatâs wrong! You forgot to play it!
Tween:Play()
Also, if you want the element to disappear then you could do this:
Tween.Completed:Connect(function()
-- no tabs because mobile
image:Destroy()
end)
I have this right now, and its giving me an error saying âunable to cast a dictionaryâ
local player = game.Players.LocalPlayer local RE = game.ReplicatedStorage:WaitForChild("Send") RE.OnClientEvent:Connect(function() print("received") local camera = workspace.CurrentCamera local worldPoint = workspace.Part.Position local Vector = camera:WorldToScreenPoint(worldPoint) --locel Depth = Vector.Z local screenPoint = UDim2.fromOffset(Vector.X, Vector.Y) local ScreenGui = Instance.new("ScreenGui", player.PlayerGui) local Gui = Instance.new("Frame", ScreenGui) local Image = Instance.new("ImageLabel", Gui) --local vectorp = screenPoint.Position Gui.BackgroundTransparency = 1 Gui.Size = UDim2.new(0.086, 1, 0.061, 1) Image.Size = UDim2.new(0.675, 0, 1, 0) Image.Image = "http://www.roblox.com/asset/?id=8057767" Gui.AnchorPoint = Vector2.new(0.5, 0.5) Gui.Position = screenPoint local TweenService = game:GetService("TweenService") local Tween = TweenService:Create(Image, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), { Image:TweenPosition(player.PlayerGui.Profile.Frame.Cash.Position) }) end)
Donât do that.
Do this:
local Tween = TweenService:Create(Image, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), { Image.Position = player.PlayerGui.Profile.Frame.Cash.Position })
Tween:Play()
Tween.Completed:Connect(function()
-- no tabs because mobile
image:Destroy()
end)