Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I stop anchored parts behaving like un-anchored parts?

Asked by 5 years ago

I have this tsunami part that is un-anchored with collisions on and works fine. (It is invisible) I have a separate part that is anchored with collisions off and it uses the script below to change its position to match the invisible tsunamis position every time the tsunami moves, except the y co-ordinate is always 24.577. (The tsunami visual part is visible) The problem is the anchored tsunamiVisual part still acts as if it is unanchored and it falls into the void and despawns.

To experience this glitch join this game: https://www.roblox.com/games/2324819039/Disastrous-Parts-Beta

Script:

local tsunami = game.Workspace.Tsunami
local tsunamiVisual = script.Parent

tsunami.Changed:Connect(function()
    local x = tsunami.Position.X
    local z = tsunami.Position.Z
    tsunamiVisual.CFrame = CFrame.new(x, 24.577, z)
end)
0
What? Your question is confusing. What is the anchored part for? Aimarekin 345 — 5y
0
Which is the visual one? Aimarekin 345 — 5y
0
the visual one is the one located in the variable "tsunamiVisual" Oxygen4Lyfe 408 — 5y
0
The anchored part is the tsunami visual part and its purpose is to always be at the location of the invisible tsunami part, but its Y position is always 24.577, unlike the invisible tsunami part Oxygen4Lyfe 408 — 5y
View all comments (5 more)
0
So the Y position is not 24.577? Aimarekin 345 — 5y
0
then anchor it.............................................. greatneil80 2647 — 5y
0
it is anchored and the Y position does change from 24.577 for no reason Oxygen4Lyfe 408 — 5y
0
It's being anchored through a script, not a local script right? Vulkarin 581 — 5y
0
its anchored from the beginning, and I checked in testing and it is indeed anchored while falling with a script that should stop it from moving to any Y position other than 24.577 Oxygen4Lyfe 408 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

Hm, couldn't you try this? It worked for me when i created a button door.

local tsunami = workspace.Tsunami local tsunamiVisual = script.Parent

for i = 1,NumberHere do tsunamiVisual.CFrame = tsunamiVisual.CFrame * CFrame.new(0,1,0) --Will basically move the part. wait() --Required so it doesn't go bonkers. Like for i = 1,20 do print("Hello world!") end It'll just print all 20. end

Oh and make sure to change "NumberHere", i'm sure you will obviously. And the cframe.new part. 0,1,0 makes it go up.

I hope you understand and i hope this works!

Ad

Answer this question