#i have a problem with projectile

1 messages · Page 1 of 1 (latest)

barren linden
#

when i shot with the revolver, the projectile dont go in direction that i want, but it fall down like in screenshot

keen kayak
#

can i see the script? @barren linden

barren linden
#

this is

barren linden
keen kayak
#

try this local Pistola = script.Parent

Pistola.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
local Bullet = Pistola.Handle.Bullet1:Clone()
Bullet.Anchored = false
Bullet.CanCollide = true
Bullet.Parent = workspace

    local UscitaProiettile = Pistola.Handle:FindFirstChild("UscitaProiettile")
    if UscitaProiettile then
        Bullet.CFrame = UscitaProiettile.CFrame * CFrame.new(0, 0, -1)

        local bodyVelocity = Instance.new("BodyVelocity")
        bodyVelocity.Velocity = UscitaProiettile.CFrame.LookVector * 500
        bodyVelocity.MaxForce = Vector3.new(1e5, 1e5, 1e5)
        bodyVelocity.Parent = Bullet
    end
    local Danno = 100
    Bullet.Touched:Connect(function(part)
        local humanoid = part.Parent:FindFirstChild("Humanoid")
        if humanoid then
            humanoid:TakeDamage(Danno)
            Bullet:Destroy()
        end
    end)
    game.Debris:AddItem(Bullet, 2)
end)

end)

#

local Pistola = script.Parent

Pistola.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
local Bullet = Pistola.Handle.Bullet1:Clone()
Bullet.Anchored = false
Bullet.CanCollide = true
Bullet.Parent = workspace

    local UscitaProiettile = Pistola.Handle:FindFirstChild("UscitaProiettile")
    if UscitaProiettile then
        Bullet.CFrame = UscitaProiettile.CFrame * CFrame.new(0, 0, -1)

        local bodyVelocity = Instance.new("BodyVelocity")
        bodyVelocity.Velocity = UscitaProiettile.CFrame.LookVector * 500
        bodyVelocity.MaxForce = Vector3.new(1e5, 1e5, 1e5)
        bodyVelocity.Parent = Bullet
    end
    local Danno = 100
    Bullet.Touched:Connect(function(part)
        local humanoid = part.Parent:FindFirstChild("Humanoid")
        if humanoid then
            humanoid:TakeDamage(Danno)
            Bullet:Destroy()
        end
    end)
    game.Debris:AddItem(Bullet, 2)
end)

end)

barren linden
shell lodge
#

with physics

shell lodge
#

that is a static image

barren linden
#

watch this

barren linden
shell lodge
# barren linden so what i can use to not use a part?

singular raycast if you don't care about size, drop, or speed

sequential raycast (ft. deltatime) if you care about speed and drop but not size

sequential shapecast/boxcast/spherecast if you care about size, drop, and speed, or even the exact shape

waxen otterBOT
#

studio** You are now Level 2! **studio

barren linden
#

thanks

subtle marsh
barren linden
subtle marsh
barren linden
subtle marsh
barren linden
#

Can you link It? Please