Hi! I come here to ask how exactly to make this part of the model look directly at the player and follow his movements. Here’s a screenshot of what everything looks like:
Is it possible to make all of this look at the player?
Please help!
Hi! I come here to ask how exactly to make this part of the model look directly at the player and follow his movements. Here’s a screenshot of what everything looks like:
Is it possible to make all of this look at the player?
Please help!
I understand that I have to use a bodyGyro, but what exactly is the script to make it look at the player?
Uhh we won’t actually make the script for you. You yourself should look on the wiki and attempt it yourself. If you are struggling to do that, then you can ask us for help with that script.
Yes, you can set a models PrimaryPart to a part then have that part move the model.
Ex.
local PrimePart = YOUR_MODEL:FindFirstChild('PART_YOU_ARE_MOVING')
YOUR_MODEL.PrimaryPart = PrimePart
YOUR_MODEL:SetPrimaryPartCFrame(CFrame.new(PrimePart.Position, TARGET_POSITION)) --This will make the part look at your target
As for the model following the player that can be done by looping this and offseting the parts position from the player. This article might help.
Alright, let me go look through that article. I was really confused on where to find this specific thing. Thank you!
This seems to give me a lot of errors. I fixed most of them but there’s two errors under Body and Target_position.
My target is suppose to be the player, however, I get an error for that. Here’s an image:
My head has been hurting all day. I shouldn’t be asking this stupid question.
You are trying to set the PrimeParts primary part as its self. You can only set a PrimaryPart to a model(Being the model you want to move).
Ex.
Body.PrimaryPart = PrimePart
Body:SetPrimaryPartCFrame()
Alright, Cframe is really complicated to me. I’m trying to move all the mesh parts at once to look directly at the player while he walks around. I followed your advice but I got a bunch of errors again. What am I suppose to change in order to get the desired result? Here’s a picture of my code and the explorer window:
Hope this makes it a little more understandable. I’m really tired rn.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local HumanoidRoot = character.HumanoidRootPart
Body.PrimaryPart = PrimePart
local RunService = game:GetService(“RunService”)
RunService.Stepped:Connect(function()
Body:SetPrimaryPartCFrame(CFrame.new(PrimePart.Position, HumanoidRoot.Position)
end)
end)
end)
Hope this helps
if you want the lets say the 'thing’s right arm to move with the players right arm you can motor6d them together
I think I confused you, I meant for the object to look at me. Not for the me to look at the object. It should be an easy fix though, right?
I edited it i think thats what u want
You should go to sleep and you might want to learn more about CFraming before attemping this.
local PrimePart = Body:FindFirstChild('PART_YOU_WANT_TO_MOVE') --Grab the part from the model you want to base the position/rotation off of
local faceTarget = CFrame.new(PrimePart.Position, TARGET_POSITION)--Grabs the lookVector(The front of the part) and faces it towards the Targets position
Body.PrimaryPart = PrimePart --Set the models PrimaryPart to the part that will control the model
Body:SetPrimaryPartCFrame(faceTarget) --Moving the PrimePart which will then move the model
Make sure to put this in a server script
Fair point
I’ll probably go through some articles and learn CFraming
Is this what you want
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local HumanoidRoot = character.HumanoidRootPart
Body.PrimaryPart = PrimePart
local RunService = game:GetService(“RunService”)
RunService.Stepped:Connect(function()
Body:SetPrimaryPartCFrame(CFrame.new(PrimePart.Position, HumanoidRoot.Position)
end)
end)
end)
[/quote]
A lot of errors, not sure why…
Do u have a primary part already set for the body?
Remember to define the body u didnt define