Hi there guys.
My question that I've been thinking about is how to access one of the 3 values found in a Vector3 /RGB value. Sure, you can add or subtract values with CFrame or name these 3 values in a variable beforehand, but what I want to do is some thing like this:
local RGB= Color3.fromRGB(23,46,69) --Make a variable that gets the first value --Make a variable that gets the second value --Make a variable that gets the third value
I've looked into the object browser for any functions to this, but I can't find anything.
Thanks.
For Vector3s you can do Vector.X
, Vector.Y
, Vector.Z
. For Colour3s you can do Colour.R
, Colour.G
and Colour.B
.
Short answer.
local newVector = Vector3.new(10, 20, 30) part.Position = Vector3.new(newVector.X, newVector.Y, 40)
Basically, I positioned a part using only the X and Y components of newVector but used 40 (instead of 30) for the Z coordinate.