I’ve recently been cracking my head with theories of how to make some random pipes appear in the right edge of the screen and scroll to the left edge perfectly. This would be flappy bird style, meaning I would need to manually customize some pipes coming together because 100% random would make it impossible.
I’m just too noob to figure out the best way
I don’t want you to make an entire system, I just want to know how to do this
Best bet would be to use TweenService and pick random pipes from a folder, spawn them in and tween them
Well but how do I know the precise CFrame where every pipe needs to be put? Because some pipes are more fat and it’s more than 1 pipe per set
Use a part and create pipes (each having their own CFrame offset if need be) on the part’s CFrame
What
Your speech is too complicated for newbies to read
Your pipe should be a model with a PrimaryPart, use the PivotTo function to set the model’s CFrame to the part’s CFrame, just tween it afterwards
Probably copy the pipes from somewhere and set its position Infront of the player by few studs and you can probably move the player to the right side continuously, instead of moving the pipes.
Moving the character is a bad idea because it is still influenced by player input
He asked before that the input is going to be only jumping, he can move the player using BodyVelocity.
My point still stands
Not really, both ideas are good
I am so confused right now. Let me try to quote as much as I can and point out what I think
The player should actually stay still because the camera stays still as well. And it had to be around 30 studs or whatever because the pipes should come out of the edge of the screen
True I made the player lose walking ability when playing.
Only problem is that while it is easy to start, I’d need a secondary PrimaryPart to also make the end.
Theory I just had
Perhaps when putting in ReplicatedStorage, I already put it at the start position? Then I add an invisible part (set as PrimaryPart) at the very end and then add a string to set the ending CFrame; then when tweening, the CFrame would glide to the CFrame set in the String Instance.Tags because idk if you're seeing this
You don’t need a second PrimaryPart, just tween it in a certain direction
Well then perhaps the theory I just had works?
(That theory includes no “secondary PrimaryPart”)
Needlessly overcomplicated
sooooo what do I do then
Literally just tween the PrimaryPart of your model so that it eventually ends up off-screen
Well ok I guess I’ll try
I’ll tag you when I’m done trying that out
There’s no use. I can’t get the Tween to play.
This is the output with the error I get
This is the script
local TweenService = game:GetService("TweenService")
local pipeCFrame = script.Parent.PrimaryPart.CFrame
local tweenInfo = TweenInfo.new(10)
local goal = {}
goal.CFrame = workspace.EndCFrame.CFrame
local glide = TweenService:Create(pipeCFrame,tweenInfo,goal)
local function work()
glide:Play()
end
workspace.Events.Start.Event:Connect(work)
you have to set the goal correctly:
local TweenService = game:GetService("TweenService")
local pipeCFrame = script.Parent.PrimaryPart
local tweenInfo = TweenInfo.new(10)
local goal = {CFrame = workspace.EndCFrame.CFrame}
local glide = TweenService:Create(pipeCFrame,tweenInfo,goal)
local function work()
glide:Play()
end
workspace.Events.Start.Event:Connect(work)