As you can see from the recording, the purple part did not detect the hit on the last humanoid. I am aware that sometimes tweenservice can cause such issues, but I was unable to fix it due to the fact that the purple part consists of multiple meshes, all of which contain a rotation script(all of the meshes have to be rotating at different axes at different speeds to achieve a certain look, which is why there are multiple rotation scripts set in each individual mesh) The purple part is also anchored.
Another issue is that from time to time the animation of the rotating parts will get choppy. I have no idea why this is happening.
May anyone please tell me how I could solve these 2 issues? Thanks in advance!
To fix the issue with detecting hits, I’d either use a raycast or Workspace:GetPartBoundsInBox() (depending on how precise you want to be) from the current position to the position from the last frame, and then killing any characters that are returned from the cast.
As for the choppy animation, if you’re creating the effects on the server, it’s better to ask all the clients to create the effects for themselves, so that there isn’t any visual lag caused by network latency.
For the most performant choice, use magnitude. It’s less costly than spatial queries such as raycasting or getpartsboundsinbox.
You would simply check the distance between the part’s position and every object in wrokspace with a humanoid, if the distance is around 2 studs (or more), do what you want.
Yeah so you should give a decent amount of studs possibly. Like 3-5 studs should be good. Although some players complain about range sometimes because they’d feel like they got hit from miles away. But that’s roblox’s fault.