Although this might be super hacky for what youāre trying to do, maybe see if alignorientation/alignposition constraints might help?
Iām not mad, Iād like you to pay attention. If I do that it overrides.
There is simply no way for you to have 2 seperate EasingStyles on a Tweening part, if you are just trying to get the CFrame, just try :Lerp()
Im not sure but how will :Lerp() help solve the problem?
If you were to create your own custom tween in a sense
yes it will help
I know how it works, but Iām not sure how it would be helpful. Iām not in need of a custom tween.
Lerp is like tweening but more simple, it lacks the Easing styles and the Properties and just goes for a Linear type transition, its used more than TweenService but unlike Lerping, TweenService provides more, however being more complex than others
Okay but how does it help solve the problem?
It should transition both Position and Orientation together.
So youāre saying iād need to create a custom tween which doesnāt override the current CFrame?
If I could ask, what are you planning to do this for? Is it something that needs to change/vary depending on the values OR will it be fixed/only for one singular model? Can the player interact with it or not at all?
If the player has no intentions of interacting with this AND its just for a singular model with no real variations/changes and no real importance in where it stops, you can probably try getting away with animating the model instead to your liking?
Back, i dont think you can due to animations usually resetting, plus if you loop it, it will be all sorts of weird and too fast
As long as the animation is looped and made properly, there should be no issues with using animations unless the OP plans to use it gameplay wise rather than visual.
The overall animation speed can also be adjusted if needed.
Tested it with weldconstraints it doesnāt work, however using normal welds it appears to workā¦ for the client anyways. Following code was used:
local tweenservice = game:GetService("TweenService")
wait(10) -- just making sure I don't miss the tweens
tweenservice:Create(script.Parent.PrimaryPart, TweenInfo.new(1, Enum.EasingStyle.Linear), {Position = Vector3.new(0, 5, 0)}):Play()
tweenservice:Create(script.Parent.PrimaryPart, TweenInfo.new(3, Enum.EasingStyle.Bounce), {Orientation = Vector3.new(0, 150, 0)}):Play()
(Quality a bit messy but you get the point)
It seems to have the odd side effect of it not replicating properly on the server despite the welds and tweens being done on the server
^ Serverās perspective
Iāll keep tinkering to find the easiest way to remedy this issue but this is the best solution I got for now.
Is this intended behavior?
Seems odd to have classic welds work like this properly but weldconstraints essentially break the model when attempting to do so
Not sure, could be intentional but it could also be a bug, in the past I just worked around this issue through hacky means.
Guess its intended
Scratch this, came up with something infinitely better,
local tweenservice = game:GetService("TweenService")
local model = script.Parent
local endcframe = CFrame.new(Vector3.new(0, 5, 0))*CFrame.Angles(0, math.rad(150), 0)
local TweenPositionInfo = TweenInfo.new(1, Enum.EasingStyle.Linear)
local TweenRotationInfo = TweenInfo.new(3, Enum.EasingStyle.Bounce)
local function TweenCFrameModel(model, endcframe, TweenPositionInfo, TweenRotationInfo)
local disconnectevents = false
local primarypart = model.PrimaryPart
local startcframe = primarypart.CFrame
model:PivotTo(endcframe)
local endpos = primarypart.Position
local endrot = primarypart.Orientation
model:PivotTo(startcframe)
for i, v in pairs(model:GetDescendants()) do
if v:IsA("BasePart") and v ~= primarypart then
local offset = primarypart.CFrame:ToObjectSpace(v.CFrame)
local checkformovement
checkformovement = primarypart:GetPropertyChangedSignal("CFrame"):Connect(function()
if not disconnectevents then
v.CFrame = primarypart.CFrame * offset
else
checkformovement:Disconnect()
end
end)
end
end
local postween = tweenservice:Create(primarypart, TweenPositionInfo, {Position = endpos})
local rottween = tweenservice:Create(primarypart, TweenRotationInfo, {Orientation = endrot})
postween:Play()
rottween:Play()
repeat task.wait()
until postween.PlaybackState == Enum.PlaybackState.Completed and rottween.PlaybackState == Enum.PlaybackState.Completed
disconnectevents = true
end
TweenCFrameModel(model, endcframe, TweenPositionInfo, TweenRotationInfo)
No buggy welds, lerp:(), or hacky animation nonsense needed, even works on the server properly unlike my last attempt with welds.
This took me a lot longer than it should and quite frankly I should have figured this out sooner, but hey its here now.
EDIT: As I am testing this I realized that if you run it on the server it looks a little choppy from the client, and running the code in a localscript seems to fix the lag but, again, it wonāt replicate. To be honest I still believe this is most likely your best approach to this quite unique problem,
so I would probably recommend a system (Probably a remotevent) for the server to tell the clients to tween the model and the server would simply just have to update the model on the server to the end position when it finishes.
Otherwise you could keep the tween on the server and simply deal with the lag if you choose that.
Whatever you choose or whatever other solution you come up with I hope this has helped you enough!
Iāll check this out later today, by taking a brief look at the code I think it might for me!
Will update the post when tested, thanks for your help.