Hey, guys/gals. Was hoping you could help me on something.

I can't get this part, called Sandbag1, to position correctly. Whenever I try and place it, it always places above where it should be. I checked the placement position I have in, and it is correct.

Code:

local Create = assert(LoadLibrary("RbxUtility")).Create
Sandbag1 = Create("Part"){CanCollide = false, Parent = Sandbags, BrickColor = BrickColor.new("Burlap"), Position = Vector3.new(-10.389, -1.394, -4.478), Rotation = Vector3.new(-90, -85, -105), Anchored = true, Size = Vector3.new(3, 1.2, 1), BottomSurface = Enum.SurfaceType.Smooth, TopSurface = Enum.SurfaceType.Smooth}

It should be placing at -1.394, but it places at 2.348, and I cannot figure out why. Its CanCollide is set to false before its placement, so it couldn't be that it was trying to go inside of another part and Collide with it.

I've been at this for a while now, and I am stumped, could one of you guys/gals help me at all?

Thanks!

5 comments

0

I'm not entirely sure if this will work, but try using CFrame instead of Position.

0

Yes. That works! Thank you so much!

0

If a parts position is set to a value and it detects a collision, it will raise the part until no collision is detected.

3

You should break giant statements like this onto multiple lines. I suggest a newline after {, and each comma

0

Hey I had this exact same problem almost a year ago. Learning how to use CFrame was the best thing I did.