Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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
0
Vector3.new() is a constructor function, not a method. It is not a descendant of a Vector3. Use it by itself. DeceptiveCaster 3761 — 4y
0
i understand but how the heck it happends like Vector3 is not valid member of Vector3? boshjio15854 15 — 4y
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 royaltoe 5144 — 4y
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. DeceptiveCaster 3761 — 4y
0
Your position is a Vector3 which means you're trying to get Vector3.Vector3 which doesn't exist royaltoe 5144 — 4y

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

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
Ad

Answer this question