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

Size, Orientation and Position values not accurate?

I tried to make a script so that when a player joins it creates a few parts and i put them in a specific part of the map with a specific size, position, and orientation but when i run the script below, it only the position is correct. The size, position, and orientation are wrong.

		local bladeModel = Instance.new("Part")
		local bladeModel2 = Instance.new("Part")
		local bladeModel3 = Instance.new("WedgePart")
		local handleModel = Instance.new("Part")
		
		local weaponTable = {bladeModel,bladeModel2,bladeModel3,handleModel}
		
		for i,v in pairs(weaponTable) do
			v.CanCollide = false
			v.Anchored = true
		end
		
		bladeModel.Size = Vector3.new(0.46, 1.43, 1.02)
		bladeModel.CFrame = CFrame.new(-0.415, -25.701, 2.49)
		bladeModel.CFrame = bladeModel.CFrame * CFrame.Angles(0, 0, 0.01)
		
		bladeModel2.Size = Vector3.new(4, 1, 0.44)
		bladeModel2.CFrame = CFrame.new(-0.45, -23.418, 2.522)
		bladeModel2.CFrame = bladeModel2.CFrame * CFrame.Angles(0, 0, 91.16)
		
		bladeModel3.Size = Vector3.new(0.46, 1.43, 1.02)
		bladeModel3.CFrame = CFrame.new(-0.502, -20.704, 2.516)
		bladeModel3.CFrame = bladeModel3.CFrame * CFrame.Angles(1.17, -88.36, 0)
		
		for i,v in pairs(weaponTable) do
			v.Parent = playerWeapons
		end

Can somebody please tell me whats wrong?

1 answer

✓ Accepted answer

Size, Orientation and Position are accurate, secondly you forgot to turn the degrees into radians since CFrame.Angles takes radians and not degrees, and you can do this bladeModel.CFrame = CFrame.new(-0.415, -25.701, 2.49) bladeModel.CFrame = bladeModel.CFrame * CFrame.Angles(0, 0, 0.01) in one line

1 comment

0

Thanks!

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