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

Fireball stays still and rotates when using BodyVelocity?

Asked by 3 years ago

So I'm trying to make a Spell.Everything works but the spell doesnt move correctly. Please help.

local slash = game.ReplicatedStorage.Slash
local root = script.Parent.HumanoidRootPart
local view = root.CFrame.LookVector

script.RemoteEvent.OnServerEvent:Connect(function()
    local clone = slash:Clone()
    clone.CFrame = root.CFrame
    clone.Position = root.Position 
    clone.Parent = workspace
    clone.BodyVelocity.Velocity = Vector3.new(view * 250)
end)

this is inside a script. I just need it to move correctly.

1 answer

Log in to vote
0
Answered by 3 years ago

1.Instead of Vector3.new(view * 250) Use root.CFrame.LookVector

  1. Set the maxforce to something high!

Script:

local slash = game.ReplicatedStorage.Slash
local root = script.Parent.HumanoidRootPart
local view = root.CFrame.LookVector
local distance_in_studs = 100

script.RemoteEvent.OnServerEvent:Connect(function()
    local clone = slash:Clone()
    clone.CFrame = root.CFrame
    clone.Position = root.Position
    clone.Parent = workspace
    clone.BodyVelocity.MaxForce = Vector3.new(5000,5000,5000)
    clone.BodyVelocity.Velocity = root.CFrame*(root.CFrame.LookVector*distance_in_studs)
end)
0
Thank you very much. You are a life saver. SitaruDaniel 44 — 3y
0
No problem :) NathanBlox_Studios 212 — 3y
Ad

Answer this question