Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is the CFrame/Positon not updating?

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

1 comment

0

What is "BulletPoint"? I'm not asking what it is I'm asking what is defined in that variable.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.