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

Is there a way of changing cframe before part is cloned?

Asked by 2 years ago

When it get cloned, there is a slight delay and it really bugs the game. Is there a way to change the cframe before it gets cloned so that "tycoon" is already at mouse hit position when cloned?

script.Parent.MousePosScript.ignore.Value = tycoon
tycoon.Parent = game.Workspace
tycoon.CFrame = tycoon.CFrame:ToWorldSpace(turnDegrees)

1 answer

Log in to vote
1
Answered by
imKirda 4491 Moderation Voter Community Moderator
2 years ago

Since code runs from top to bottom, you just swap them, part is only becoming visible after Parent property is set to something in Workspace:

script.Parent.MousePosScript.ignore.Value = tycoon
tycoon.CFrame = tycoon.CFrame:ToWorldSpace(turnDegrees)
tycoon.Parent = game.Workspace
0
tip: think of code as noodles imKirda 4491 — 2y
0
its still the same thing GameStealerKid 79 — 2y
0
(not the same, just doesnt work anymore) GameStealerKid 79 — 2y
0
what do you mean it does not work, in what way? it errors or the cframe does not change at all? imKirda 4491 — 2y
View all comments (2 more)
0
no errors, it just doesnt work GameStealerKid 79 — 2y
0
it works with position but not cframe GameStealerKid 79 — 2y
Ad

Answer this question