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

Why are the bullets in my gun not moving? The body velocity is in the bullet and it isn't anchored.

Asked by
Master_JJ 229 Moderation Voter
8 years ago

I just want to say that I made sure the part is unanchored.

I used remote events, so there are two scripts.

Server Script:

01local tool = script.Parent
02local event = tool.ClickEvent
03local handle = tool.Handle
04 
05function createPart()
06    local part = Instance.new("Part")
07    part.Parent = workspace
08    part.Size = Vector3.new(.2, .2, .2)
09    part.BrickColor = BrickColor.Yellow()
10    part.Anchored = false
11    part.CanCollide = false
12    return part
13end
14 
15event.OnServerEvent:connect(function(player, mouseLocation)
View all 23 lines...

Local Script:

01local player = game.Players.LocalPlayer
02local mouse = player:GetMouse()
03 
04local tool = script.Parent
05local event = tool.ClickEvent
06 
07 
08tool.Activated:connect(function()
09    local mouseLocation = mouse.Hit.p
10    event:FireServer(mouseLocation)
11end)
0
Just a thought: might the bullet be automatically creating welds with other objects when you put it into the workspace? If that is happening, the solution would be to call :BreakJoints on the bullet (after line 18). chess123mate 5873 — 8y

Answer this question