Still have questions? Join our Discord server and get real time help.
Log in to vote

Projectiles, BodyVelocity, lookVector... how to hit my target?

Asked by 14 days ago

So i create and fire a fireball in fron't of the player towards the mouse. My problem is that the fireball travels toward the furthest point in the map the mouse is pointing at, rather than the intended target(enemies/Models)

So for expamle if i was pointing my mouse at a player, yet my camera was looking from above, the fireball would move to the mouse position beyond the player and therefore miss entirely.

thanks in advance

local FireBallClone = FireBall:Clone()
    FireBallClone.CFrame = Char.HumanoidRootPart.CFrame *,0,-3)
    FireBallClone.Parent = workspace

    local BodyVelocity ="BodyVelocity", FireBallClone)
    BodyVelocity.MaxForce =, math.huge, math.huge)

        for i = 0, 1000 do
                FireBallClone.Size = FireBallClone.Size +,0.05,0.05)
                BodyVelocity.Velocity = Mouse.lookVector * i
Use raycasting. Even if your script is super efficient, raycasting will beat it since it is coded in C++. NO seriously, use raycasts. No buts, doesn't matter, raycasts are better. sleazel 394 — 14d

Answer this question