I need help/tips on creating a semi-accurate bullet collisions
Currently I only have this piece of code that checks for collisions or not
local collision = workspace:Raycast(bullet.Position,bullet.CFrame.LookVector,rParams)
if not collision then print("NONE") task.wait() continue end
print(collision.Instance)
I have tried using workspace:GetPartsInPart(bullet) and its not accurate as well so I really don’t know how to do this
You’d have to show the code behind that to really demonstrate why that was happening. I’ve used workspace:GetPartsInPart() for my projectile hitboxes and it worked fine.
Did the same happens when the NPCs were close to you?
And also, have you tried using the .Touched event with a loop that keeps fixing its position? As I’ve explained in the solution of my first post, the loop is able to make the .Touched event become accurate for some reason, but I’m not sure how it would be for high speed projectiles.
I don’t really know, you should try turning their CanQuery on and testing. Before saying anything about that test, you should also try the other solution I’ve suggested using the .Touched event.
I think the workspace:GetPartsInPart() was the right choice, .Touched seems to not output anything
Only real problem I’m encountering with the collision checking is for far away distances, could be my trash aim since it works 100% of the time on close ranges so idk, I’ll mark it as the solution though thx!
If it works on close distances, it probably is related to the direction the projectile is going to, so you should also check if your projectile is not going down or something too. But yeah, I’m glad I helped, good luck!