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

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)

Sorry! was busy, it seems to me that your running everything in just one continuous loop, try to run things in different threads what i mean is use coroutines. This is so for handling visual effects such as glass breaking can be handled in separate thread.

It is also clear to me that because of the fact your not handling visual effects properly, its actually causing the game to hit a bottleneck. This is indicated from testing not sure if you are using coroutines or not, but i strongly advise you do mate.

function bullet_Visuals(destination,etc...)
    --Visual code such as bullet and glass breaking
local func = coroutine.new(bullet_Visuals)
coroutine.resume(func,destination,etc...)

Something like this could greatly reduce “lag”(in quotations because in this case you wouldn’t necessarily call this lag but more like a bottleneck)

I use spawn(function() instead, and yes, i already do this.

If you are then , I’m assuming this is completely different topic about visual effect handling, which i doubt would require this topic to continue being active. Good Luck!

Thank you for helping me for this long!

How did you position the surface gui where the bullet was hit?

1 Like

I used a module by orange451. Its called world to surface gui.

On the surface gui the frame changes sizes on different parts with different sizes how do I keep it the same for every part the surface gui is on?

Also I have another question is the ray following the bullet or is it just immediate?