I’m aiming to create a resizing platform that carries the player along with it as the platform resizes.
What is the issue?
The issue is that the player doesn’t actually move with the platform, the object I’m standing on has a BodyPosition as a child of the platform so I figured this would apply when the part resizes too but it doesn’t.
The output that I expected was a system like this where the player stays at the same relative point as before it resized (apologies for my poor drawing):
Obviously I intended the BodyPosition to also account for size change, but considering the position doesn’t change, the size changing wouldn’t apply to the player moving with it so at this point, I’m honestly clueless. I haven’t found any solution anywhere on the dev forum to my knowledge, if something similar has been posted before then I apologise.
Thanks in advance to anyone who can assist me with this issue!
What are you using to resize the platform? Are you tweening the Size?
From your video it’s resizing pretty quick.
I don’t know if an Anchored Part would allow for the player to move.
Yes, a tween is used to resize the part, I’m resizing the part to 8 studs width on the x axis and then the z axis repetitively.
The part isn’t anchored as a BodyPosition is used to keep the position of the part in place. Here’s the relevant code which applies the tween to the part if needed:
local originalBlockResizingPlatformSizes = {}
local stagesResizingBlockLength = {}
local resizeType = 1
local resizingTweenInfo = TweenInfo.new((60 / trackSoundBPM / 2), Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, true, 0)
for _, blockResizingPlatform in ipairs(blockResizingPlatformsFolder:GetChildren()) do
local resizingTween
if resizeType == 1 then
resizingTween = TS:Create(blockResizingPlatform, resizingTweenInfo, { Size = originalBlockResizingPlatformSizes[blockResizingPlatform] + Vector3.new(stagesResizingBlockLength[trackModel.Name][stageFolder.Name]["Resize Length"], 0, 0) })
resizingTween:Play()
elseif resizeType == 2 then
resizingTween = TS:Create(blockResizingPlatform, resizingTweenInfo, { Size = originalBlockResizingPlatformSizes[blockResizingPlatform] + Vector3.new(0, 0, stagesResizingBlockLength[trackModel.Name][stageFolder.Name]["Resize Length"]) })
resizingTween:Play()
end
resizingTween:GetPropertyChangedSignal("PlaybackState"):Connect(function()
if resizingTween.PlaybackState == Enum.PlaybackState.Completed then
blockResizingPlatform = originalBlockResizingPlatformSizes[blockResizingPlatform]
end
end)
end
The ‘originalBlockResizingPlatformSizes’ table just contains the original sizes of each platform since I have multiple of these platforms demonstrated.
The ‘stagesResizingBlockLength’ table contains the amount the part should resize to, in this case, it’s ‘8’ studs.
Resizing may just not allow for moving the player depending on the percentage of the distance they are from the center. Have you tried it with much slower speeds and a much larger ‘stagesResizingBlockLength’ to see what that does to the physics?
Imagine what would happen if you were standing right at the corner of the original 6x6 platform, you’d be tossed 1 stud side to side, then backward and forward every time the resize script ran!