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

Why is the CFrame/Positon not updating?

Asked by 1 year ago

I have a gun system and I'm adding bullet spread whenever the gun shoots, depending on a value it clones the bullet to a certain part. for some reason the bullets are shooting out of where the gun was laying on the ground.

this is the Cloning code I tried Both CFrame and Position both having the same issue

local function CreateBullet(mouseLookVector)
    local NewBullet = Bullet:Clone()
    if BPV.Value == 1 then  NewBullet.Position = BulletPoint.Position
    end
    if BPV.Value == 2 then  NewBullet.Position = BulPoint2.Position
    end
    if BPV.Value == 3 then  NewBullet.Position = BulPoint3.Position
    end
    if BPV.Value == 4 then  NewBullet.Position = BulPoint4.Position
    end
    if BPV.Value == 5 then  NewBullet.Position = BulPoint5.Position
    end
    local direction
    if GunInfo.ShotgunAspect then
        local x = math.random(-GunInfo.Spread*100, GunInfo.Spread*100)/100
        local y = math.random(-GunInfo.Spread*100, GunInfo.Spread*100)/100
    else
        direction = mouseLookVector
    end
    local OriginalDamage = GunInfo.Damage

everything is welded to the handle and nothing is anchored. this wasn't an issue until I added multiple bullet points

0
What is "BulletPoint"? I'm not asking what it is I'm asking what is defined in that variable. T3_MasterGamer 2189 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago

You know how to make a 'script' then put = false? I am just adding a suggestion! ¯_(?)_/¯

Ad

Answer this question