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

Bullet Focus Part?

Could this be Changed b.Position = mouse.Hit.p to b.Position = Tool.Focus? Cos I was testing a Gun and it didn't work out well, am not sure though if thats cos of that line or not, but am asking guys, cos I dont want the Bullets to go were the Mouse is pointing... its so unrealistic!

1 answer

Where did you get the method 'Focus', for a Tool, because I can't find it.

The only reference I can find is for the Camera.

If you want the bullet to point where the gun is pointing, use the lookVector, either on the Handle/Barrel, or Right arm of your character:



bullet.CFrame = CFrame.new(
	--Position
	tool.Handle.Position + tool.Handle.CFrame.lookVector*2, -- push the position forward a little

	--Direction
	tool.Handle.CFrame.lookVector*9999999999	-- sometimes lookVec can be a lil' in-accurate
)

2 comments

0

I want the Bullet to be spawned at the Barrel and then shot at say, 'BarrelPos' as it's Focusing Part... if u get wat am saying...

0

Yeah, just change 'tool.Handle..' to 'tool.Barrel'.

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