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

Any way to get precise position of part when part.Touched fires?

My game is about shooting people with gravity weapons. All damaging bullets explode on Touched and deal AoE damage. Some bounce once before exploding, some slide 5 seconds then explodes.

The problem is roblox physics is bad. How can't this engine propperly tell where a part is when it touched something? Server bullets have like 7 studs distance from the touched part when .Touched was fired. I had to even make so every client shoots the same bullet to make an average of every player result, to see who is more reliable to calculate damage with, but this isnt the best workaround, i guess.

1 comment

0

Not only my game, I tested a lot of weapons on free models that uses only velocity to shoot and they all have inconsistent shots that even dont damage the player when clearly hits them.

1 answer

Hmm, you could try using Swordphin123's Raycast Hitbox Module to use raycasting instead of touched. Basically, instead of touched it'll raycast to itself when it moves. That way you can get the in-between of a fast moving part with a generally good amount of accuracy.

https://devforum.roblox.com/t/raycast-hitbox-module-for-all-your-melee-needs/374482


You could even make physics calculations yourself and use entirely CFrame, but it's quite a lot of work. There is a guide on this website that does it for a gravity. In your case, you could search up physics equations and try to do it?

https://scriptinghelpers.org/guides/modeling-a-projectiles-motion

1 comment

0

I did a custom physics with cframe already, with gravity and bounciness, but i can't actually figure how to add friction and rolling effects, and one of the bullets has 0 elasticity to keep rolling after collison after 5 seconds. My Physics: https://gyazo.com/17062e80dc20970689193ae88a5f7421

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