How would I make an entire model follow the character?

I have tried looking for solutions on the developer hub on this issue, but to no avail.

Basically; I want the monitor model to rotate based on the character model. No changing positions, just to rotate.

Here’s kind of like a concept video but without anything working:

Please tell me how I could execute this, thanks

5 Likes

Have a look at CFrame.lookAt()

2 Likes

my guess is you can use roblox lookat thingy to do it, then just set the X and Z coordinates to like 0.

function pointAtPlr(Char) -- char should be the character of the player
model.PrimaryPart.CFrame = CFrame.new(model.PrimaryPart.Position, Char.PrimaryPart.Position)
model.PrimaryPart.Rotation -= vector3.new(model.PrimaryPart.Rotation.X,0,model.PrimaryPart.Rotation.Z)
end

Not sure this will work but Im making a guess

3 Likes

Is there a particular method that works with :PivotTo()? This just doesn’t follow the character when I try to apply it

1 Like

Isnt PivotTo the same as just setting the CFrame of the primaryPart? Cause last I checked it was

2 Likes

Oh, this is the code and it doesn’t work for some reason: (note its in a loop)

local monitor = workspace:WaitForChild("Monitor")
local monitorPivot = monitor:GetPivot()
monitor:PivotTo(CFrame.new(monitorPivot.Position, char.HumanoidRootPart.Position, monitorPivot.Rotation.Position - Vector3.new(monitorPivot.Rotation.X,0,monitorPivot.Rotation.Z)))
1 Like

any errors?

Summary

This text will be hidden

1 Like

No, but this is what it’s doing
image

1 Like

are all the parts welded to the models primary part?

1 Like

It’s anchored and I’m using :PivotTo() instead of fiddling with PrimaryParts and welds.

2 Likes

can you show a video of what happens?

1 Like

I can and will; but basically the monitor is stuck at 0,0,0 on the position property and 0,0,0 for it’s orientation and won’t budge and goes outside of the place it’s supposed to (which is on top of the cylinder)

1 Like

this and with a RenderStepped function could work.

2 Likes

Can you at least try my method?

1 Like

Do you want it to just rotate on the y axis?

1 Like

Just weld all the parts to the main part, its better that way and probably more optimized

1 Like

Yes please. Thanks for asking. (ignore the last part its because of character limit)

1 Like

I worry about exploiters pushing around the monitor though

1 Like

If the models primary part is anchored it shouldnt be a problem.

1 Like

I would actually recommend using a bodygyro, it’s simple to use and it’s alot smoother. (Only use a bodygyro if you are experiencing the smoothness of the model being bad).

1 Like