Hello, I’m just wandering how to tween parts forward from their original position, I have a script that might make them go forward but I spawn alot of Models at time and they would all go to a single area together. I just need help on how they can go forward from their spawn.
code of my idea:
local LiftPosition = {CFrame = CFrame.new(-255,Item.Position.Y,Item.Position.Z)*CFrame.Angles(0,0,0)}
Idk if its what your looking for but look vector extends a point by a certain amount of studs
local default = TweenInfo.new(10,Enum.EasingStyle.Linear)
local ExtendDistance = 900--Studs extended by
local TargetPos = PartToMoveTo.CFrame.LookVector * ExtendDistance
local goal = {}
goal.Position = TargetPos
local tween = TweenService:Create(MovingPart, default, goal)
tween:Play()
The "XVector " Doesn’t exist, just do what I did, CFrame.LookVector, If it works than good, if if doesn’t go in your intended direction or doesn’t work than we can fix it.
Yeah, I just changed it to see what happens, also they still move to the same place, I kinda wanted them to move Independently, also what if I change it to a local script?
I would recommend you to see that the error gave an error that you have provided a Double value, means a number basically. It is because you are trying to set the CFrame of the model like this
target = item.CFrame.X * Extended
Which obviously will give the X Coordinate (A Number), but you will need to pass a CFrame value to the CFrame property of a model. So how you could frame your code is like:
local item= script.Parent
local TweenService = game:GetService("TweenService")
local TweenStyle = TweenInfo.new(60, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local Extended = 350
local goal = {}
goal.CFrame = item.CFrame * CFrame.new(Extended, 0, 0)
local TweenUp = TweenService:Create(item,TweenStyle,goal)
TweenUp:Play()
wait(58)
script.Parent:Destroy()
Aight im not sure what to do since the scripts you guys gave would either move to the same place or just sink to the ground, at this time im just testing the Local Scripts
Are you sure you have tried that code itself? It Seems to work fine for me, if you are saying that you tried XVector or that thing, that property doesn’t exist, If this is the case, I would say to try with my code.