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.