-
What do you want to achieve?
I am trying to change the position of a cloned object. This original object is in ReplicatedStorage. The cloned object is moved to a folder in Workspace. -
What is the issue?
Objects are maintaining the position of the original ReplicatedStorage.Target position -
What solutions have you tried so far?
See code below - I have tried searching multiple DevForum posts but I am not see an issue with the code
local radius = 100
while true do
wait(5)
local target = game.ReplicatedStorage.Target:Clone()
local angle = math.random(1,360)
local x = radius * math.cos(angle)
local z = radius * math.sin(angle)
target.Position = Vector3.new(x, 5, z)
target.Parent = workspace.Targets -- This is a folder in Workspace
end
The object in ReplicatedStorage is called “Target” and has a position of 0,0,0. On line 14, I try to set the cloned Object ‘target.Position’ to my generated values, nothing happens. The game continues to set the parent to Workspace and maintains the original position found in ReplicatedStorage.
Any help is appreciated.
When running the script - here are a few example X, Z values that are generated:
27.519231863229308 -96.13891968218607
-99.6087835141185 8.836868610400144
54.03023058681398 84.14709848078965