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

BodyPosition won't Behave as Intended?

Asked by 9 years ago
bodyposition.position = character.Torso.CFrame:pointToWorldSpace(Vector3.new(0,0,-20))  --Assume every variable is defined as its name

So, basically I've been trying to get a Part to shoot out to 20 studs in front of the character after its been positioned it in front of the character (which is not shown here, but you don't need that). This snippet of code is what I have been using. Instead of shooting out to 20 studs in front of the character, the part will simply make an arc downwards. What am I doing wrong?

Entire function:

function spells.Fire()
    local fireball = game.ServerStorage.Mage.Fireball:Clone()
    local bodyposition = Instance.new("BodyPosition",fireball)
    fireball.CFrame = character.Torso.CFrame:toWorldSpace(CFrame.new(0,0,-3))
    bodyposition.position = character.Torso.CFrame:pointToWorldSpace(Vector3.new(0,0,-20))
    fireball.Parent = game.Workspace
end

Answer this question