LoordySr
(LoordySir)
November 15, 2023, 6:20pm
#1
Hello.
I am currently working on plot system, saving and loading and it’s going smoothly. However, an issue spawned in. Since I’m saving placed object’s CFrame relative to the plot, and loading it relative to the plot, it loads on the red spot instead of the green one (the plot on the right). Which is not how I want it.
The question is: How would I make it load on the green spot ?
(From the green spot on the left plot to the green spot on the right plot.)
Thank you for your help
You can add an option allowing you to rotate the plot (like for example Lumber Tycoon 2)
Elseif you can also try turning the plot directly in the studio to see if anything changes,
if you put a plot in rhoumbus ?
Else you can make a script that detect what plot is it(if plot.Name == Plot2 then
turn)
(sorry for mistakes im french)
Tinarg
(Tinarg)
November 15, 2023, 7:00pm
#3
You can use CFrame:ToObjectSpace()
and CFrame:ToWorldSpace()
to load objects relative to the plot’s rotation.
Something like
local localCF = platform.CFrame:ToObjectSpace(object.CFrame)
object.CFrame = rotatedPlatform.CFrame:ToWorldSpace(localCF)
would move object
from platform
to rotatedPlatform
, keeping the rotation of the platforms in account.
system
(system)
Closed
November 29, 2023, 7:00pm
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.