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

Why is this script changing the objects axis?

So basically I am trying to fill a model with a part which I am using as a camera focus part. The issue I am facing is that some of the model's axis are being changed. For example the x would be changed to the z etc.

Here is the code so far

local weapons = script.Parent:GetChildren()

for i = 1,#weapons,1 do
	if weapons[i].Name ~= script.Name then 
		local part = Instance.new("Part")
		local o,s = weapons[i]:GetBoundingBox()
		part.Size = s 
		part.CFrame = o
		part.Parent = weapons[i]
		part.Anchored = true
		part.Transparency = .7
		part.Name = weapons[i].Name .. "FOC"
		part.BrickColor = BrickColor.new("Royal purple")
		print()
	end
end

3 comments

0

CFrame contains orientation, you can try using CFrame.Position = o.Position

0

Oh thank you

0

I just tried and i t gives me an error. The error it says is 'Position cannot be assigned to'

1 answer

CFrame contains orientation, you can try using CFrame.Position = o.Position

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