Tween not moving whole model

Hi everyone,

I looked this up (because it is a simple problem) but all the answers I found were people doing things ive already tried, and it working for them - and of course, none of them have worked for me.

anyway, my problem is this: when I try to tween a model, only the part i’m tweening is moving. 46a1270e4e131cc10872100e79fa59d2
the core part (what i’m tweening) is the only thing moving. all of the other parts (the ones stuck in my character) are all unanchored and welded to the red ball, but no dice. the tweened part is also the primarypart, for what its worth.

im prettymuch at a complete loss here. everything i can find says that this should be working perfectly, and up until a few days ago it WAS working. while iterating on the script it just suddenly broke. i dont have a version of the script that tweens it properly, sadly.

so i would be in debt for any insight or experience you can all provide :slight_smile: here is the code:

function firespell(player,rootpartcframe)
	--grabs and parses target
	local target = targetingReturn:Invoke(player)
	local goalPosition = {Position = target.PrimaryPart.CFrame.Position}
	local tweenTime = (((rootpartcframe.Position - target.PrimaryPart.CFrame.Position).Magnitude)/projectileVel )
	local tweenInfo = TweenInfo.new(tweenTime,Enum.EasingStyle.Linear)
	--clones fireball and sets it in workspace
	local theFireball = abilityAssets.Fireball.Fireball:Clone()
	theFireball:SetAttribute("Lifetime", tweenTime)
	theFireball.Parent = game:GetService("Workspace")
	theFireball:SetPrimaryPartCFrame(rootpartcframe)
	--yields until fireball is set
	local brochill = workspace:WaitForChild("Fireball")
	--the tween
	local tween = tweenService:Create(theFireball.PrimaryPart,tweenInfo,goalPosition)
	tween:Play()
end

its a bit of a block of text, so sorry about that. any tips on formatting would also be appreciated :slight_smile: thank you all in advance!

1 Like

have you tried making the object you’re tweening the primarypart of the model?

1 Like

i cant believe i didnt mention that. yes, it is the primarypart.

maybe make a RunService.RenderStepped function while the fireball is flying and change the HumanoidRootPart CFrame to the fireball’s? (+/- the coordinates of how far of it it should be)

1 Like

that could work, but i fear that a RenderStepped function would tank frames, and that setting the CFrame relative to the root part could cause floating point errors to make the model wobble around. i will try it to see if it works though! thank you for the idea :slightly_smiling_face:

2 Likes

Are you sure it’s properly welded onto the fireball? Seems like its welded onto the Right Hand.

1 Like

im fairly certain the welds are correct, but for sure that it’s not on the right hand. the model isnt welded to anything after it’s cloned, so it definitely wouldn’t be welded to his hand.


there are 2 weld constrains parented to the model that weld both parts to the core part separately. not totally certain if that’s how im supposed to do it to be honest, but again it was working before, so im not sure why it wouldn’t work now.

Other parts should be anchored though! Otherwise while tweening some problems could occur.

1 Like

um, pretty sure Part0 should be the CenterPart and Part1 should be the part you are attaching

1 Like

really? i had read that they should be unanchored! sadly, anchoring the other parts didn’t seem to work. Thank you though!

i swapped them around, and nothing changed :confused:

Hello! I had exactly the same issue whilst working on my game. Instead of tweening the “position” property, tween the “CFrame” property and you should be fine! :smiley: Keep me posted!

4 Likes

oh my god, this was it. thank you so so much! i will definetly remember that next time, lel

2 Likes

Haha, that’s exactly what I thought when I figured that out :joy:

2 Likes

Yes, if you don’t anchor them they will tend to fall while their position isn’t controlled all the time by a script.