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

i tried to do an 8 bit animation and somehow vector3 is not valid member of vector3 what the heck?

i was making a game and in the starting i got again question and keeping this error for a while the script type is: script. so in Y position i tried to edit it and somehow it pop ups this error: 18:55:45.133 - Vector3 is not a valid member of Vector3. is that a bug or an real error? please explain me. heres the script:

wait(5)
local currPOS = script.Parent.Position
local infstring=1

repeat
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z)
	wait(0.25)
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z)
	wait(0.25)
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z)
	wait(0.25)
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z)
	wait(0.25)
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z)
	wait(0.25)
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z)
	wait(0.25)
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z)
	wait(0.25)
	currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z)
until infstring == 0

5 comments

0

Vector3.new() is a constructor function, not a method. It is not a descendant of a Vector3. Use it by itself.

0

i understand but how the heck it happends like Vector3 is not valid member of Vector3?

0

It should be script.Parent.Position = Vector3.new(some x position, y position, z position ) You can also minimize your code with a loop

0

A Vector3 is a matrix that does not contain any other matrices. Its values are X, Y, Z, and 3D offset. It does not have other Vector3's because it is simply not a CFrame.

0

Your position is a Vector3 which means you're trying to get Vector3.Vector3 which doesn't exist

1 answer

✓ Accepted answer

Like Bash and I said in the comments, you're getting the error because position is vector3 value and you are trying to get a vector3 of a vector3. If you want to change the position, you'd instead do script.Parent.Position = Vector3.new(posX, posY, posZ) posX, posY, and posZ being some numbers.

Here's what I was talking about in the comments when I said you could shorten your code into a for loop:

Also, I have a question for you, infstring is always going to be 1 in this example, what are you trying to do?

--idk what script parent is so i'm naming it foo for now. try to think of a better name for script.Parent please.
local foo = script.Parent 

wait(5)
local infstring=1

repeat
	--reapeat code inside for loop 4 times
	for i = 1, 4 do
		script.Parent.Position = Vector3.new(foo.Position.X , foo.Position.Y + 0.25 , foo.Position.Z)
    		wait(0.25)
	end

--reapeat code inside for loop 4 times
	for i = 1, 4 do
		script.Parent.Position = Vector3.new(foo.Position.X , foo.Position.Y - 0.25 , foo.Position.Z)
    		wait(0.25)
	end
until infstring == 0

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