Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Parts being re-aligned when setting CFrame?

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.

1 comment

0

I'd really like some help!

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.