Vector3 not changing object position and Orientation

Fixed it myself
I am trying to Change the position of a part through a textbutton

Vector3 is not changing the position neither Orientation ethrough script.

I printed something after the function executed to see that the function was running.
I am using a script(not local script)
The script is child of the textbutton
And the script is under startergui.

-- 
wait(20)
script.Parent.Visible = true
function clicked()
	game.Workspace.CameraPart.Position = Vector3.new(45.821, 21.695, 45.2)
	game.Workspace.CameraPart.Orientation = Vector3.new(45.821, 21.695, 45.2)
	print("Finish")

end
script.Parent.MouseButton1Click:Connect(clicked)

Output
image

Could you give any more information on this, or is that it?

Use a CFrame! CFrame’s do this and more CFrames | Documentation - Roblox Creator Hub in your case
I think game.Workspace.CameraPart.CFrame = CFrame.new(45.821, 21.695, 45.2,45.821, 21.695, 45.2)) should work

I think roblox cancels these on the client for unknown reasons to me but I think the same code should work on the server

First of all, you should put everything except for script.Parent.Visible = true above the wait(20). That might be what is causing the issue.

Also, if you are intending for it to change on the server, you will need to use a RemoteEvent. otherwise only the player who clicked the button will see the part move and no one else. RemoteEvent | Documentation - Roblox Creator Hub

1 Like

Putting a event under a wait should not cause any issues

Edit: I had this problem before and using a CFrame fixed it