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

What's causing this BodyVelocity to output an error?

: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

✓ Accepted answer

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

2 comments

0

Thanks a bunch :)

0

NP!

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