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

How to do a Vector3Value Calculation (-Vector3.x)?

How would I make a Vector3Value = the value of another Vector3Value, but, subtracts (1) from Vector3.x ? Below is what I have tried...

while wait(1) do
	script.Parent.Parent.Value = script.Parent.Parent.Parent.Off.Value.x - 0.635
	wait(6)
end

3 comments

0

Wait what? I don't understand a thing you said.

0

Basically, I want to take (100, 0, 0) in a value and subtract to make it (99, 0, 0).

0

Off.Value - Vector3.new(1,0,0) like how blue said.

1 answer

✓ Accepted answer

It's almost always better to do math with full Vector3s rather than to do the .x, .y, etc yourself.


You want to subtract something from Off.Value. So we should be expecting something like:

Off.Value - something

something should have 1 as an x value, and it shouldn't affect y or z. blah - 0 is still blah, y and z should be 0.

Off.Value - Vector3.new( 1, 0, 0 )

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