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

What's causing this BodyVelocity to output an error?

Asked by 6 years ago

:I'm trying to change a specific value in a BodyVelocity (The X Vector), but when I try to do it via script I get this error: X cannot be assigned to 09:26:37.935 - Stack Begin 09:26:37.936 - Script 'Workspace.NoteTrack.BaseNotes.NoteA.Base.BodyVelocity.Script', Line 1 09:26:37.938 - Stack End

:I tried using one line of code to do it and it gave me the same error, what should I do?

script.Parent.Velocity.X = 100

:I want to be able to change only the x value, and not the y or the z (Though I will if I must), but how would I have to change this script in order to make it work?

1 answer

Log in to vote
0
Answered by 6 years ago

I tested it, and this following piece of code works:

script.Parent.Velocity = Vector3.new(100, script.Parent.Velocity.Y, script.Parent.Velocity.Z) -- Change the X, but retain the Y and Z

tada

0
Thanks a bunch :) EnderGamer358 79 — 6y
0
NP! sweetkid01 176 — 6y
Ad

Answer this question