-
What do you want to achieve? Keep it simple and clear!
I’m trying to change the HumanoidRootPart’s CFrame with a Mouse Click -
What is the issue? Include screenshots / videos if possible!
I’m getting an error clicking saying player is not a valid member of Workspace.I get the same error when just using HumanoidRootPart. I know these things aren’t members of the workspace but do I have to use global variables or am I missing something like Getplayerfromcharacter
Script:
-
local clickDetector = script. Parent
-
function onMouseClick()
-
game.Workspace.Player.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0,5,0) -
end
-
clickDetector.MouseClick:connect(onMouseClick)
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried using Player.Character and Getplayerfromcharacter, probably incorrectly. I’ve looked for many solutions. Thank you for your time.