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

how to make bullet holes with physical bullets?

so i was wondering how do u make bullet holes i am using physical bullets im not looking for scripts just ideas

2 answers

✓ Accepted answer

There was an almost identical question yesterday, so I will give you the basics of my answer to that question.

All you need is the CFrame to place the part that the decal is on, and by using the normal you got from the FindPartOnRay, you can get the exact position and rotation that the decal part needs to be: CFrame.new(HitPosition)*CFrame.Angles(math.rad(Normal.X),math.rad(Normal.Y),math.rad(Normal.Z)). From there you would create a part with the bullet hole decal on it and give it this CFrame.

Also, you would get the surface normal by using local HitPart, HitPosition, Normal = workspace:FindPartOnRay(ray)

So while you can use physical parts for bullets, I wouldn't recommend using the touched event to register hits as that doesn't offer you a lot of support. Just use ray casting and CFrames.

2 comments

0

why i dont use raycasting is because you can't put a speed on the bullet or have bullet drop if there is a way to do that please tell me!

0

All of those points is exactly why you should use ray casting

Hi botw_legend,

You can use the CSG API to accomplish this. However, I recommend using ray-casting to identify the part in which to make the bullet. Anyway, CSG API allows you to solid model an object through scripts. I haven't used it yet but I bet it's really cool.

###Here is a link to the API on the DevForum.

##Good luck and have a nice day/night.

Thanks,

Best regards,

Idealist Developer

5 comments

0

ill try it now!

0

while this does look cool i was thinking of something where an image goes to the place where you shot not destroying the material

0

Would not recommend this, I have done it before and it causes significant amount of lag when multiple bullets are fired. It also increases in complexity with the amount of bullet holes on a single part, thus increasing the lag even more.

0

Also depending on the fire rate, if the part gets hit by a bullet and its not done calculating the union before getting hit a second time, it will error and usually will break something.

0

i just want an image to go to where the bullet hit

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