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

Using Vector3 doesn't makes my part on the right position?

I have this button that is supposed to resize and reposition a part. But a problem I have a lot is that vector3.new and tweening can't have a part in a position if there is other parts in the way.

Not Anchored - Not wrong position sat - Checked many times

Script:

click = script.Parent.ClickDetector
local Giver = script.Parent.Parent.Parent.Giver
local av = false

function wat(player)
		if av == true then
			av = false
			Giver.Position = Vector3.new(9.774, 0.825, -6.403)
			Giver.Size = Vector3.new(1.57, 0.25, 4.11)
			Giver.Transparency = 0.2
			script.Parent.BrickColor = BrickColor.new('Really red')
			script.Parent.Parent.Main.SurfaceGui.Frame.TextLabel.Text = "AUTO COLLECTER          OFF"
		elseif av == false then
			av = true
			Giver.Position = Vector3.new(6.18, 0.722, -38.968)
			Giver.Size = Vector3.new(191.59, 0.05, 159.38)
			Giver.Transparency = 1
			script.Parent.BrickColor = BrickColor.new('Lime green')
			script.Parent.Parent.Main.SurfaceGui.Frame.TextLabel.Text = "AUTO COLLECTER          ON"
		end
	end

click.MouseClick:connect(wat)

2 comments

0

I don't know the technicalities as to why Vector3s cannot go through Parts but to do what you want, use CFrames instead.

0

Thx, I thing I used Cframes at a time because it didn't worked but the script is removed so couldn't remember.

1 answer

✓ Accepted answer

use CFrame to have a part be able to be in a certain position without physics getting in the way also I would reccomend making the part anchored if you want it to be inside a different part otherwise the physiscs will influence it. good luck

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