#Merging BodyVelocity and BodyAngularVelocity

5 messages · Page 1 of 1 (latest)

brittle knoll
#

lol

#

did u try CFrame and BodyVelocity like this```lua
local part = -- your ball Part here
local speed = -- desired speed for movement
local angularSpeed = -- desired speed for spinning

-- set the CFrame to move the ball
part.CFrame = part.CFrame + part.CFrame.lookVector * speed

-- set the BodyAngularVelocity to make it spin
part.BodyAngularVelocity = Vector3.new(0, angularSpeed, 0)```

quaint kernel
#

am new to scripting how dos dis work

#

my script is

local ReplicatedStorage = game:GetService("ReplicatedStorage")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)

        local HumRoot = char:WaitForChild("HumanoidRootPart")
        local lemon = game.ServerStorage.Lemon:Clone()
        lemon.Parent = char

        local Velocity = Instance.new("BodyAngularVelocity")
        Velocity.Parent = lemon

        local humanoid =  char:WaitForChild("Humanoid")
        local Weld = Instance.new("Weld")
        Weld.Parent = lemon
        Weld.Part0 = HumRoot
        Weld.Part1 = lemon
        humanoid.PlatformStand = true

        while true do
            wait()
            lemon.BodyAngularVelocity.AngularVelocity = Vector3.new(char.Humanoid.MoveDirection.z * 70,0,char.Humanoid.MoveDirection.x * -70)
            lemon.BodyAngularVelocity.MaxTorque = Vector3.new(10000,10000,10000)
            if char.Humanoid.MoveDirection == Vector3.new(0,0,0) then
                lemon.BodyAngularVelocity.MaxTorque = Vector3.new(0,0,0)
            end
        end
    end)
end)
#

lemon is thae ball