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.
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 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 thank you all in advance!
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)
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
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.
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! Keep me posted!