Whenever I fire my weapon, the block comes up, and then there is like a .2 second delay before the velocity kicks in.
01 | game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect( function (plr,tool,handle,mouseHit) |
02 | local l = Instance.new( "Part" ,workspace) |
03 | l.BrickColor = BrickColor.new( "Toothpaste" ) |
04 | l.Size = Vector 3. new( 1 , 1 , 3 ) |
05 | l.CanCollide = false |
06 | l.Anchored = false |
07 | l.CFrame = handle.CFrame |
08 | l.CFrame = CFrame.new(l.Position,mouseHit.p) |
09 | local v = Instance.new( "BodyVelocity" ,l) |
10 | v.Velocity = l.CFrame.lookVector * 100 |
11 | v.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
12 | end ) |
You don't want to use the second parameter of Instance.new() because it takes longer.
You want to first set the properties and then parent it.
01 | game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect( function (plr,tool,handle,mouseHit) |
02 | local l = Instance.new( "Part" ) |
03 | l.BrickColor = BrickColor.new( "Toothpaste" ) |
04 | l.Size = Vector 3. new( 1 , 1 , 3 ) |
05 | l.CanCollide = false |
06 | l.Anchored = false |
07 | l.CFrame = handle.CFrame |
08 | l.CFrame = CFrame.new(l.Position,mouseHit.p) |
09 | local v = Instance.new( "BodyVelocity" ) |
10 | v.Velocity = l.CFrame.lookVector * 100 |
11 | v.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
12 | v.Parent = l |
13 | l.Parent = workspace |
14 | end ) |
I mean just look at this pic, noticeable difference.