High speed tween object not detecting hits sometimes, along with choppy animation


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!

You would want to use raycasting or shapecasting to detect hits

each time it moves a certain distance, raycast towards its direction with a small distance

give Raycast Hitbox a try

2 Likes

I’ll look into this when I get back on Studio again, thank you so much for the reply!

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.

1 Like

I’ll try implementing what you said, thanks a lot for the help!

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.

2 Likes

if the magnitude is small enough then it’d be possible that it just ignores things in certain scenarios so watchout for that

1 Like

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.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.