I’ve been trying to make a water current for a while now but I have failed every time.
Now I’m not a good coder by any means, I’d say that I can’t even code at all. I do know how to fix this though, I just don’t know how to implement it correctly.
This is the code I’m using.
while true do
script.Parent.Velocity = script.Parent.CFrame.rightVector *40
wait(0.1)
end
The only thing that it needs is to apply force to a certain body part, Like the LowerTorso or UpperTorso, But I have NO Idea on how to implement this.
there is another way without coding just make a part nd from properties change
" assembly " and you now made Conveyor belts
(you can put it at the bottom of water)
That would work for most cases, but as they specified it has to be canCollide = false.
But a possible solution would be putting a conveyor part like that under the water part. This would work if the water isn’t very deep. @Covolts try this
Is it on a part? Lets assume not, lets assume its in the player. You need to make it check the name that its going to apply it to.
Or if its the part you just do the same but use :Touched()
A checkmark means that they can collide with each other. Default and Default can collide with each other. Default is like the ground/terrain.
Click on +Add Group and type in a name you want for your water part.
You can now close the Collision Groups Editor.
Make sure in the Properties of your water part, you change its CollisionGroup name from Default to WaterPart or the name you called it.
local char = script.Parent
for _,part in char:GetDescendants() do
if part:IsA("BasePart") and part.Name ~= "LowerTorso" then
part.CollisionGroup = "players" -- the name of collision group you call it
end
end
Since the there’s no custom animation or player cannot jump while on the fake water part, it pushes the player off even if there’s no conveyor set because the rootpart is not touching it and it thinks the player is falling. You have to make the water part a two part if the water is deep so that there is an invisible collidable block so the player can tiptoe on it, or scale the water part shorter like in the video, or use a script to listen to Touched event and change the Humanoid’s HipHeight. Here I changed it to 8.2 and I was able to capture the still image of the character model floating moving slowly. The number varies depending on how tall the part is. Mine was 8 studs tall.
while true do
script.Parent.Velocity = script.Parent.CFrame.rightVector *40
wait(0.1)
end
Not exactly an answer to your question (I think it’s already been provided fairly well), but you never need to make this a loop if you have the script.Parent part anchored. Just make this