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

Bullets are not going through objects without collisions?

Asked by 4 years ago

I'm working on a gun right now which fires out bullets. I want them to go through objects that have collision turned off (borders, hidden parts, etc.), but they stop when they reach the object. Also hit.Name can't seem to detect the bullet. It'll return the name for any object that touches the parent of a script that has it but it can't detect the bullet.

Here's the server script. I got most of it off of a tutorial here: https://devforum.roblox.com/uploads/short-url/WQW6iS1i344HHrPXbvyIA1pUWV.rbxl and the page that goes along with it is here: https://devforum.roblox.com/t/how-to-make-ranged-weapons-with-bullet-movement/606618/2

Any help is appreciated :) I'm new to Lua scripting so I would prefer answers that give me the entire working script to copy and paste in.

Once again, the problems are that the bullets don't go through objects with collisions and that other objects cannot detect a hit by them. This is only part of the weapon so it'll help to reference the whole tutorial for the other parts and scripts.

01local weapon = script.Parent
02 
03local fireRemote = weapon.Fire
04 
05local configs = weapon.Configuration
06 
07local speed = configs.Speed.Value
08local dropDistance = configs.DropDistance.Value
09local damage = configs.Damage.Value
10local dropAngle = configs.DropAngle.Value
11 
12local function CreateFire(startPosition, direction)
13    local ray, object, position
14 
15    local bullet = Instance.new("Part")
View all 77 lines...
0
Line 41, try `if object and bullet and object.CanCollide then` Block_manvn 395 — 4y
0
@Block_manvn It pushes the player when it hits though, and it still doesn't fix the bullet collision detection issue with other parts. Bob4koolest 78 — 4y

Answer this question