Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Vector3 expected, got CFrame?

Asked by
wentman 19
5 years ago
Edited 5 years ago

This is quite literally the stupidest thing I have seen. This line of code has been annoying me for 2 hours, and I don't know how to fix it. So I turned to you all.

Workspace.Script:89: bad argument #2 to '?' (Vector3 expected, got CFrame)

Script

for i, v in pairs (game.Workspace.Rubble:GetChildren())do
TweenInf = TweenInfo.new(6,Enum.EasingStyle.Bounce,Enum.EasingDirection.Out,0,true,0)

Properties={
    CFrame = v.CFrame + CFrame.new(0,30,0)--Error occurs. 
    }

Tween = TweenService:Create(v, TweenInf, Properties)
    Tween:Play()
end

I tried changing CFrame.new to Vector3.new but it returns another error.

1 answer

Log in to vote
0
Answered by
gullet 471 Moderation Voter
5 years ago

CFrame.p is a Vector3, if you want to move something 30 studs upwards you can do CFrame = v.CFrame + Vector3.new(0,30,0)

0
You can find the CFrame documentation here: http://wiki.roblox.com/index.php?title=CFrame gullet 471 — 5y
0
I swear I tried that before but it didn't work. Thanks wentman 19 — 5y
0
it should now be CFrame.Position lol theking48989987 2147 — 5y
Ad

Answer this question