Pancake going in a non wanted position/gets father from character

Im having a problem, once the player clicks the pancake its suppose to go up then down but instead it goes a completely different direction, also as the player moves the pancake gets farther away from the pan when clicked. im using a weldConstraint to weld the pancake and the pan together. photo:
boo
Screenshot 2023-06-26 221925
video:

script im using:
local tool = script.Parent
local handle = tool:WaitForChild(“Handle”)
local Pancake = tool:WaitForChild(“Pancake”) – the pancake model
local middle = tool:WaitForChild(“Middle”) – where the pancake sits on
local TS = game:GetService(“TweenService”)
local db = false – debounce
local Multi = tool:WaitForChild(“Multi”) – flips multi
local sss = game:GetService(“ServerScriptService”)
local PopUp = require(sss:WaitForChild(“PancakePopUp”)) – get module
local seconds = tool:WaitForChild(“Seconds”) – basically debounce
local swoosh = middle:WaitForChild(“Swoosh”) – audio
local info = TweenInfo.new( – tween info
0.8,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
0,
true,
0

)
local StartTween = Pancake.Position + Vector3.new(0,1,0) – bring pancake up
local CloseTween = Pancake.Position + Vector3.new(0,-1,0) – bring pancake down
local TWStart = TS:Create(Pancake,info,{Position = StartTween}) – tween pancake
local TWClose = TS:Create(Pancake,info,{Position = CloseTween}) – tween pancake

tool.Activated:Connect(function()
if not db then
db = true

	local plr = game.Players:GetPlayerFromCharacter(tool.Parent)
	
	PopUp.PopUp(plr,Multi,seconds) -- pancakePopUp
	swoosh:Play() -- audio
	plr.leaderstats.Flips.Value = plr.leaderstats.Flips.Value+Multi.Value -- add value
	TWStart:Play()-- play tweens
	wait(0.5)
	TWClose:Play() 
	
	wait(seconds.Value)
	db = false
end

end)

1 Like

Try setting Reverses in your TweenInfo to false, rather than true.

all that did was stop it from returning to its previous position.

Actually nevermind I know the issue, you’re using Pancake.Position as a loose end to make the tween, but you didn’t consider that it’d be a static position (it doesn’t change to match) and is also the position of the pancake when not equipped (where it’s positioned if you parent the tool to workspace)

You need to make it relative to where the pancake is at currently. The easiest way to do that is to use an actual Weld, and modify the C0/C1 (I forget which) to flip the pancake.

1 Like

It now works i needed to do a little research about tweening welds.
[
heres the post if anybody’s curious.

Can you tween welds?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.