Flexer97YT
(Flexer97YT)
September 12, 2019, 10:32pm
1
I’m trying to tween a part in a specific position using a variable, but when I use a print for see the position, I always receive 0,0,0
local ts = game:GetService("TweenService")
game.ReplicatedStorage.Disparo.OnServerEvent:Connect(function(player, pos)
local cloneBullet = game.ReplicatedStorage.Bullet:Clone()
cloneBullet.Parent = game.Workspace
cloneBullet.Position = game.Workspace[player.Name].HumanoidRootPart.Position
local tInfo = TweenInfo.new(0.2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local goal = {
Position = Vector3.new(pos)
}
local tween = ts:Create(cloneBullet,tInfo, goal)
tween:Play()
end)
1 Like
twinqle
(twinqle)
September 12, 2019, 10:34pm
2
Print the “pos” argument at the very start of the remote event and before the event is fired on the client. Tell us what you get.
Flexer97YT
(Flexer97YT)
September 12, 2019, 10:39pm
3
I have put 3 print. One in the localscript before firing the event, and two in the script. The first at the beginning print(pos) and the second at the end print(goal).
This is the result:
1 Like
twinqle
(twinqle)
September 12, 2019, 10:42pm
4
change
Position = Vector3.new(pos)
to
Position = pos
This would probably fix it, if not let me know. Sorry that I can’t put it in Lua format, I’m currently on mobile.
4 Likes