How would one make bullet piercing without fast cast or any other api?

Fixed the game and added more features:

  • Bullets ignore invisible parts
  • Bullets can now break glass (still being worked on, not released)

Might make a seperate post for this game!

Congrats though it seems to me particles last longer than they should realistically might want to play around with that.

If i used :Emit it would look horrible. I’ve tried to reduce it but it looked terrible

Also i think that you are in the wrong server, i am currently in game and i dont see you anywhere

How did you make ricochet instead of piercing?

I made the bullet look the oppistire direction, meaning it sort of bounced

You would make a ricochet by actually casting a ray from the position hit making the destination a negative x value of the original caster, from how i would do it.

I know how to make it but you tried making something else and made ricochet.

It was a result of a bug :confused: There isn’t much logic behind it just affect

I just tried the game, i think there are some bugs when you are lagging. I disabled my audio because it is glitchy, dont worry the audio is fine

robloxapp-20210312-1652560.wmv (9.6 MB)

sorry for many edits, I just keep changing the video file everytime i find new “bugs” or something

Yesterday I did a system revamp, fixing piercing, fixing sound bugs and adding more features. You can play the game yourself to see it.
EDIT: Also made it R15 so my blood engine can work :man_shrugging:
EDIT2: For the fixed piercing, i scrapped the last idea and did the recursive raycasting like you said.


I used this method

1 Like

Just found a piercing bug, seems like the ray for some reason is not ignoring the part. It may be because there are two pierceable parts inside each other, making confusion to the server.

1 Like

Yeah honestly that is to be a better solution, i personally didn’t have time to fix bugs on my sort of go on the tps system. I also have a similar bug but i think the causes are different. To me it seems that maybe there is a issue with the logic of your code, could you post the pierce function?

You could fix it by making a number for max piercing when you are hitting parts since in real life it it will loose speed after hitting something . Like this;

Maxpierces = 20
Pierces = 0

If hit and pierces ~= Maxpierces then
pierces = pierces + 1
end

2 Likes

just tested again, when shooting glasses on the thin side, the bullet hole effect stays, even if the glass is broken, the broken glass disappears, and after waiting for a minute. But when shooting the glass on the thick side, its normal. Also why did you remove the face of the player

edit: the npc does not seem to respawn or intentionally does not respawn, make it respawn so we can shoot it more

edit2: some glass does not reload, probably a lag issue or forgot to add a script
robloxapp-20210315-1052283.wmv (2.1 MB)

edit3: got kicked for cheating? i was just holding the lmb. Maybe you are spamming the remote events

edit4: pressing left ctrl locks the cam in place, the last time i tested this, pressing makes the mouse free.
also is this normal ricochet behaviour?
robloxapp-20210315-1057575.wmv (1.7 MB)

edit5: ricochet going crazy?
robloxapp-20210315-1112361.wmv (903.8 KB)

Thank you for this, i am fixing them all this moment.

tell me once you are done fixing, so I can help find more bugs (probably)

Another thing, that ricochet is added on purpose, otherwise, if I inverted the Y axis, the bullet would freak out
The kick thing has been nerfed and I’m working on a better system.
I’m fixing the other bugs, should be relatively easy.

EDIT: I’m working on foot planting and procedural animation (although, it wont be coming in a very long time).

I found a hard to repro bug (probably luck-based), but I managed to do it again.
Edit: The repro is just to face ur cam down as possible then equip and unequip any gear, and wish for luck that you might do it
robloxapp-20210317-1940546.wmv (2.8 MB)
I just opened the console for that bug and this showed up, the video is just to show how fast it errors


robloxapp-20210317-1932238.wmv (880.4 KB)

Edit2: the glass respawn is still buggy when lagging.
This may be intentional, but after a bullet pierces through a wall, anything else it touches does not do anything, glass does not break, bullet hole effect does not show, but the bullet is still visible. That makes sense though
Edit: this is just a video showing what I mean
robloxapp-20210317-2000030.wmv (2.9 MB)