Problem with :SetPrimaryPartCFrame()

Hi, I am making a system of taking blocks and dropping them, the problem is to keep it in front of my HumanoidRootPart, I have a Part called “Block1” that I put in my Custom Character and in front of the HumanoidRootPart, so what I do is simple, put the model to the position of the block, obviously I use
:SetPrimaryPartCFrame() but I have a problem that when constantly updating the CFrame of the Model inside a .RenderStepped Event it gets bugged and I start to fly anywhere, from what I have seen the blocks appear with Velocity and RotVelocity which I suppose is the problem.

Connection = RUN.RenderStepped:Connect(function()
	Block_Selected:SetPrimaryPartCFrame(Character.Block1.CFrame)
end)

image

The culprit of this will be the WeldConstraint or not?

What am I doing wrong?

I really appreciate your comments and solutions, thanks :smile:

2 Likes

You can only use SetPrimaryPartCFrame on Models that have a PrimaryPart, and I think you’re using SetPrimaryPartCFrame on a Part.

If you are not, what is the model you’re using? The box model you’ve just showed on that screenshot?

no, sorry for the variable name, Block_Selected is a Model

Edit: yes, is the box model

Did you set a PrimaryPart for that model?

yes, it has a PrimaryPart Set.

Does the output show any errors?

any error, this is how the problem looks:

1 Like

So the problem is flinging? If so you’re going to have to add collision groups and script them using Physics Service.

Or maybe it’s something related to CanCollide.

no, the problem is when the model follows the player

Do all the parts inside the box model have the CanCollide property set to false?

2 Likes

ohhh, since it didn’t occur to me I thought I had already tried it, I disabled the CanCollide of all parts of the model from the script and it worked, it no longer fails

1 Like