I am trying to make an ocean with a texture on top. I add the texture and, instead of the texture being affected by the StudsPerTile property, it just acts like a decal. The OffsetStuds property doesn’t work either, which I need to animate the water. The part has a special mesh in it to make the ocean B I G. If I remove the special mesh, it will act normal. Obviously, I don’t want an island being larger than the ocean, so, I have to keep it.
I am not sure but for some reason it does not work last time I checked. I figure it is because Roblox cannot calculate a face’s size to do UDim properly
I did use foil. But I want it to animate. I also thought of using foil but moving the position of the part, but if people were playing still like 10 hours later, the ocean will be 100 miles away. I also thought of changing the material to plastic then changing it back to foil every frame, but idk how to do that.
I’m using lerping to move it up and down. So, if I change the rotation, the lerping will just set it back to normal.
Here is my script that moves it up and down:
local waveHeight = 0.02
while wait(1) do
for i = 0, 1, 0.01 do
wait(i * 0.1)
script.Parent.CFrame = script.Parent.CFrame:Lerp(CFrame.new(script.Parent.Position + Vector3.new(0, waveHeight, 0)), i)
end
wait(1)
for i = 0, 1, 0.01 do
wait(i * 0.1)
script.Parent.CFrame = script.Parent.CFrame:Lerp(CFrame.new(script.Parent.Position - Vector3.new(0, waveHeight, 0)), i)
end
end
I looked up how to lerp with rotation. It said to multiply the current CFrame by CFrame.Angles(0, math.rad( --RADIAN-- ), 0). I don’t know much about radians. Can you editt my script please? Sorry, I just don’t know how to do it. It’s confusing
math.rad turns a degree into a radian and unfortunately I am no math wizard to help you out here with very detailed explanations. I don’t even understand why multiplying the coordinate frames with an angle works besides “it just does.”
I have been working on a script for you here but I have to go to sleep, it is pretty late for me. I will try to send it ASAP tomorrow. In the meantime, you should do the understanding cframes walkthrough by Roblox if you haven’t already.