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

Why isn't this velocity script working?

I am working on a train system for my miniature city simulator and the parts with velocity keep falling so I added this script into one of the carriages

game.Workspace.TrainFront.BodyForce.force = Vector3.new(0, TrainFront:GetMass(),-2)

and in the output it says as an error Workspace.TrainFront.Script:2: attempt to index global 'TrainFront' (a nil value) Can anyone help?

1 answer

✓ Accepted answer

It should be

Workspace.TrainFront.BodyForce.Force = 
Vector3.new(0,Workspace.TrainFront:GetMass(),-2)

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