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 Want to make the pokemon tween to the same cframe as the pokeball -
What is the issue? Include screenshots / videos if possible!
The pokemon tweens to a random cframe close to the pokeball’s cframe -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I searched every possible post with a similar problem and found nothing.
The square is supposed to be the “Pokeball Cframe” according to the module script, i made it so it creates a part with the same cframe as the pokeball to show the problem better.
Here is the module script
local TS = game:GetService("TweenService")
-- The target is the pokemon btw
local module = {}
function module.CatchAnimPlay(Target:MeshPart, Pokeball:Part)
Target.Anchored = true
Target.TextureID = ""
Target.Material = Enum.Material.Neon
Target.Transparency = 1
local a1 = Instance.new("Attachment", Target)
local a2 = Instance.new("Attachment", Pokeball)
task.delay(.3,function()
Pokeball.AssemblyLinearVelocity = Vector3.zero
Pokeball.AssemblyAngularVelocity = Vector3.zero
Pokeball.Anchored = true
Pokeball:WaitForChild("Beamforpoke").Attachment0 = a1
Pokeball:WaitForChild("Beamforpoke").Attachment1 = a2
end)
local TS1 = TS:Create(Target, TweenInfo.new(1.5), {Size = Vector3.new(5,5,5), Transparency = 0}) :: Tween
TS1:Play()
TS1.Completed:Connect(function()
local newCframe = game.Workspace:WaitForChild(Pokeball.Name).CFrame
local part = Instance.new("Part", workspace)
part.Anchored = true
part.Size = Vector3.new(5,5,5)
part.CFrame = Pokeball.CFrame
local TS2 = TS:Create(Target, TweenInfo.new(1), {CFrame = Pokeball.CFrame, Size = Vector3.new(0.1,0.1,0.1)}):Play() :: Tween
end)
end
return module