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

Why isn't this velocity script working?

Asked by 10 years ago

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

Log in to vote
1
Answered by
Hybric 271 Moderation Voter
10 years ago

It should be

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

Answer this question