TweenService saying Position / CFrame element doesn't exist within a part, although it does

  1. What do you want to achieve? Keep it simple and clear!
    I am trying to create a platform that has two tweens that it goes back and fourth from, to make a platform that goes back and fourth from an island to another, similar to SuperTux’s famous Flying Propeller Platform.

  2. What is the issue? Include screenshots / videos if possible!
    I keep getting an error, and it is an error I don’t know how to fix. It keeps saying the “Position” property for these tweenservice goals are invalid, but I know they aren’t.

Here is the code:

local TweenInformation = TweenInfo.new(4,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,-1, false,0)

-- TWEEN ONE
local TweenGoal_One = {
	Position = game.Workspace.Game.Map_Arena.Islands.Main_Island.PlatformWaypoints.Waypoint_Ruins.Position}
local TweenOne = game.TweenService:Create(script.Parent, TweenInformation, TweenGoal_One)

-- TWEEN TWO
local TweenGoal_Two = {
	Position = game.Workspace.Game.Map_Arena.Islands.Main_Island.PlatformWaypoints.Waypoint_Main.Position}
local TweenTwo = game.TweenService:Create(script.Parent, TweenInformation, TweenGoal_Two)

while true do --Note: This basically stops your code, so nothing below it runs. Add the spawn() function to it like the example above if you don't want that.
	TweenOne:Play()
	TweenOne.Completed:Wait()
	TweenTwo:Play()
	TweenTwo.Completed:Wait()
end

And here is a screenshot of the error.
Screenshot 2025-06-17 155533

  1. What solutions have you tried so far? Did you look for solutions on the Creator Hub?
    I looked for solutions on the forums, but nothing popped up, so I decided to go to plan B. I tried using CFrame instead of Position as the property, but it still had the same error, thinking CFrame for the Platform part never existed.

Im trying to do this for fun, to make my game more popular. So far, I’m doing great in the entire remaster of the island arena. Please help if you can, it’d be appriciated! :slight_smile:

2 Likes

Is the script under a BasePart or under a Model?

1 Like

I initially thought your issue was the formatting and using reverse without meaning to, but @DataSigh’s question probably gets to the issue.

You need the script.Parent to be a Part, or change the code to reflect that. BaseParts can be moved with Tweenservice, but Models can not.


I tried to remake what I think your intent was here:
TweeningAPartToTwoOtherPartRemake.rbxl (55.8 KB)

1 Like

It’s under a basepart, but it can’t find the position of it.

Oh, I realized it now! Models don’t have a “Position” or “CFrame” property (to my understanding), so what you asked was if it was under the part or the model. It was under the model, and now I understand why it wasn’t working! Thank you!

My last question now would be:
Since it works, I’m trying to have the beam and propeller fly with it, only that they’re … staying in place? How do I FIX this to finally make THIS work?

Video:

2 Likes

Just tween the model like this (also set the PrimaryPart to something in the model):

local TweenService = game:GetService("TweenService")

local function CreateTweenForModel(Model: Model, TweenInfo: TweenInfo, GoalCFrame: CFrame): Tween
    assert(Model.PrimaryPart, "MODEL DOES NOT HAVE A PRIMARYPART!!!!!!")

    local CFrameValue = Instance.new("CFrameValue")
    local Tween = TweenService:Create(CFrameValue, TweenInfo, {Value = GoalCFrame})

    CFrameValue.Value = Model.PrimaryPart.CFrame

    local Connection = CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
        Model:PivotTo(CFrameValue.Value)
    end)

    Tween.Completed:Once(function()
        Connection:Disconnect()
        CFrameValue:Destroy()
    end)

    return Tween
end

CreateTweenForModel(Model, TweenInfo.new(bla bla bla), CFrame.new(1,1,1)):Play() -- Example
1 Like

Now would this work with the two tweens I want it to iterate over?

No, it wouldn’t. The tween isn’t doing anything, and it’s just making the tween for the CFrame object. The model isn’t being used, so technically, it wouldn’t work, considering that the model isn’t being used anywhere else but the assert.

Although the model is being pivoted too the cframe value, it isn’t changing the position, meaning that the model doesn’t move, it just stays there, not doing anything.

Bro it does work​:skull::skull::skull: (30charlimit)

Did you even give it a try? :skull_and_crossbones: :skull:

Yes, I did. It still didn’t work.

Ensure that everything is under the same Model and that there is a PrimaryPart defined.

Afterwards, you can move that entire model through that PrimaryPart, using CFrames.