Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Use of NormalId?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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!

Ad
Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

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
0
Doesn't work, but if you change it to ":pointToWorldSpace" then it starts working, but it SwaggyDuckie 70 — 9y
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 SwaggyDuckie 70 — 9y
0
also, if you put the ".Position" to the end, it will error. SwaggyDuckie 70 — 9y
0
You're correct, I forgot pointToWorldSpace even exists. CFrame.Position doesn't exist, but CFrame.p *does*, that's not a typo. adark 5487 — 9y

Answer this question