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

How can i make it so a monsters head looks at you as walking?

Asked by 4 years ago

I literally have no idea how to do this, help is extremely appreciated. :D

2 answers

Log in to vote
0
Answered by 4 years ago

Insert this into game.StarterPlayer.StarterCharacterScripts:

if workspace.Monster.Head:FindFirstChild("Neck") == nil then
workspace.Monster.Neck:Destroy()
end

local newConstraint = Instance.new("WeldConstraint", workspace.Monster.Head)
newConstraint.Part0 = workspace.Monster.Head
newConstraint.Part1 = workspace.Monster.HumanoidRootPart

while true do
    workspace.Monster.Head.Orientation =  Vector3.new(0,script.Parent.Head.Orientation.Y - 45,0)
    wait(0.01)
end
0
i don't understand Pipe_Gamerz 4 — 4y
0
sorry :( User#29913 36 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Use CFrame.new, but the first argument is the position it's at and the second argument is the position it's looking at.

Sample:

local MR = math.random;

local a = Instance.new("Part",workspace);
a.BrickColor = BrickColor.new("Really red");
a.Position = Vector3.new(MR(1,10)-5,MR(1,10),MR(1,10)-5);
a.Anchored = true;

local b = Instance.new("Part",workspace);
b.Position = Vector3.new(MR(1,10)-5,MR(1,10),MR(1,10)-5); -- These positions are randomized
b.Anchored = true;


a.CFrame = CFrame.new(a.Position,b.Position)
 -- this is the part where variable "a", the red part, looks at variable "b" the grey part

Answer this question