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

Parts being re-aligned when setting CFrame?

Asked by 6 years ago

Hello, I have this code right here:

        local Bullet = Instance.new("Part",game.Workspace.Bullets)
        Bullet.Size = Vector3.new(1,1,1)
        Bullet.Transparency = 0
        Bullet.CFrame = Tank.CFrame

But, everytime I try to set the CFrame (Like I'm doing on the last line)

I'd like to point out:

"Tank" is a unionOperation.

Printing Tank's Position is correct.

Printing Bullet's Position is about 1 stud above tank's (even though I'm setting the exact CFrame value)

I have tried to set Bullet's canCollide to false, has no effect.

I have looked, and looked, I could not find any information. I know (by default) that when you set the position of a part, it will go on top of the part. This is not the case, I'm setting the CFrame.

0
I'd really like some help! Internal_1 344 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Just found the answer to my question, so if anyone else stumbles upon this:

Apparently, with the way I coded this, I cannot set the part shape, when setting the CFrame, or this will happen.

Fix: Don't set the part's shape with Part.Shape, just use a mesh to accomplish the shape.

THIS IS A ROBLOX BUG.

EDIT:

Just tried setting the mesh, it doesn't work. This is extremely odd! I cannot set the CFrame of a part inside of another part if I set the mesh/shape.

Ad

Answer this question