script.Parent.Humanoid.Parent:MoveTo(Vector3.new(CFrame.new(plr.Character.HumanoidRootPart.CFrame + CFrame.new(0, 0, -4))))
It’s likely one of those 3 CFrame’s you palced was not expected to be there, since a Model
MoveTo
expects a Vector3, hence the error. Try changing it to this
script.Parent.Humanoid.Parent:MoveTo(Vector3.new(plr.Character.HumanoidRootPart.Position + Vector3.new(0, 0, -4)))
Or alternatively since you don’t really need to make a new Vector3 since Position is a vector3 by default
script.Parent.Humanoid.Parent:MoveTo(plr.Character.HumanoidRootPart.Position + Vector3.new(0, 0, -4))
do
script.Parent.HumanoidRootPart.CFrame = plr.Character.HumanoidRootPart.CFrame + CFrame.new(0, 0, -4)
if you want to keep the rotation
MoveTo
already preserves the Orientation of a model, your method will basically do the same thing as mine, move the model by -4 on an axis
Wait… Why not do
(plr.Character.HumanoidRootPart.CFrame + CFrame.new(0,0,-4)).p
Thats the easiest way to turn CFrame into Vector3.
Why wrap a CFrame.new around a cframe?
Oh sorry about that… xD Wait lemme
It s still would make it difficult to understand the line since we’re going from a CFrame to a Vector3, when it’s better to find a method that just uses Vector3 at the beginning since MoveTo
’s only parameter requires a Vector3
@NotWhutThe That’s how OP did it, he’s just taking from it and thinking of a way to fix the issue as well
First method i tried, working but not, how i want
What are you trying to do? Are you trying to move the Character sharply or by them walking to that point? How is it not working how you don’t want?
I making stands. Me need move the stand to coordinates (player.X - 5)
It could be cause you used the wrong axis, as the 3rd one is the Z axis
Try this
script.Parent.Humanoid.Parent:MoveTo(plr.Character.HumanoidRootPart.Position + Vector3.new(5, 0, 0))
Yes, this script worked how i want. But stand move to back of torso player. Me need that stand move to the ahead of torso.
I think it requires you to use trial and error when working with Vector3s to find the correct value, maybe use -5
instead of 5
?
The same thing. Me need use CFrame. But MoveTo needed in Vector3.
Eh, I’d try the following if you want to move the player to a certain position.
local pos = plr.Character.HumanoidRootPart.CFrame + Vector3.new(0, 0, -4)
script.Parent.Humanoid.Parent:SetPrimaryPartCFrame(pos)
Thanks for answer, but me need move stand to plr.HumanoidRootPart
Can you elaborate further? I don’t get what you mean, do you mean like rotate the character?
Me need move Stand to coordinates with orientation player on X + 5
Maybe this?
local pos = plr.Character:GetPrimaryPartCFrame() * CFrame.new(5, 0, 0)
script.Parent.Humanoid.Parent:SetPrimaryPartCFrame(pos)