Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Use of NormalId?

I need help with Vector3.FromNormalId(). I need to make an object(pet) to walk in side of me(right) and I think I'd have to use Vector3.FromNormalId() to do it. My code(which I forgot to save) was:

--of course it won't walk in side of me.--
local Pet = game.Workspace.Model
local Player = game.Players.Player
while wait() do
	Pet.Humanoid.WalkToPoint = Player.Torso.Position
end

that was only I could've accepted, but It didn't walk in side of me, instead it walked in legs of mine, and I kinda kicked it so many times, and like that, that in real word, it would be dead meat. You also couldn't get its mood, 'cause the legs were infront of it. I made a Click Detector Gui that you can check its level, experience, hunger, thirst, mood and health. So the hidden face is kinda no problem. But otherwise it's very annoying.

Thanks,

SwaggyDuckie

2 answers

✓ Accepted answer

Do what ContinentOfEurope said. But use it like this: His mistake is that he multiplied the NormalId with a Vector3 value instead of a float.

local Pet = game.Workspace.Model
local Player = game.Players.Player
local Distance = 5 --How many studs away from you
while wait() do
    Pet.Humanoid:MoveTo(Player.Torso.Position +
(Vector3.NormalId(Enum.NormalId.Right)*Distance))
--Use MoveTo. I made it on different lines so you can see what is happening.
end

Hope it helps!

I've said it in chat a few times, you need to use vectorToWorldSpace:

local Pet = game.Workspace.Model
local Player = game.Players.Player
local Distance = 3

while wait() do
    Pet.Humanoid.WalkToPoint = Player.Torso.CFrame:pointToWorldSpace(Vector3.NormalId(Enum.NormalId.Right)*Distance).p
end

4 comments

0

Doesn't work, but if you change it to ":pointToWorldSpace" then it starts working, but it

0

it works Pretty bad. The pet doesn't have enough speed to stay right next to me, so I have to make the WalkSpeed higher

0

also, if you put the ".Position" to the end, it will error.

0

You're correct, I forgot pointToWorldSpace even exists. CFrame.Position doesn't exist, but CFrame.p does, that's not a typo.

This discussion is preserved as it was. New answers, comments, and votes are closed.