Server script can not set BodyVelocity Velocity?

I’m scripting a hovercraft using BodyVelocity and BodyAngularVelocity. It works by supposedly setting the Y Velocity to an IntValue, but the BodyVelocity object properties did not change at all.

This is the setup:

local Main = script.Parent.Main.Value 
local throttle = script.Throttle -- an IntValue


local bVelocity = Instance.new("BodyVelocity")
bVelocity.MaxForce = Vector3.new(0,99999,0)
bVelocity.Velocity = Vector3.new(0,0,0)
bVelocity.Parent = Main

local bAngularV = Instance.new("BodyAngularVelocity")
bAngularV.AngularVelocity = Vector3.new(0,0,0)
bVelocity.Parent = Main

-- Where the Velocity is set:
RunService.Heartbeat:Connect(function()
	bVelocity.Velocity = Vector3.new(0,throttle.Value,0)
    print(bVelocity.Velocity)
end)

When I have the script change the Throttle IntValue, print(bVelocity.Velocity) outputs it as it should. But the Main part isn’t moving, and the Velocity property is somehow still 0,0,0.

I can not seem to set the AngularVelocity as well right from the start, it still inherits the default (0,2,0) angular velocity and not the one I set above.

I’m quite confused. when I change it manually as the server in a studio run test, it changes, but the script can only think it changed it. Thank you for any help in advance.

Hold on, aren’t you directly creating a new BodyAnguarVelocity instance so how can it inherit a default angular velocity? Isn’t it by default (0,0,0,)?

Seems to be a typo error, the bAngularV parent was not changed to main.

For the body velocity issue, I have no clue how it is not changing the code as well.
Edit:
Do you have multiple body velocities?

You are parenting it to a value and not the part it is affecting? Maybe that’s the problem?

Edit 2: or maybe another script in the workspace that could possibly effect the movement of the hovercraft?

1 Like

Thank you for pointing these out. I had a duplicate, and as you mentioned, I parented the BodyVelocity instead of the BodyAngularVelocity.

1 Like