Gun stops working correctly after a couple of minutes [SOLVED]

Hello. I’m working on a game that involves using rocket launchers in which I made one. The rocket launcher works completely find but runs into one issue after using it after awhile.

The way the rocket launcher works is that when the released bullet touches a part, a function will run where it would check all the maps in the map, any part that has a magnitude of 3 or less will be effected by the bullet and will be pushed and turn red.

The video below shows this in action:

The problem is that after awhile (about 3-4 minutes) the rocket launcher will stop working correctly. The bullet will still shoot but when it hits a part close to it, it won’t effect that part even if the magnitude is 3 or less. Instead, it just leaves the part alone.

I’ve checked over my code to see if there is anything that can be causing this, but I don’t see anything wrong at all that can make this happen. I also did prints to see the magnitude of every part and for some reason, it just completely ignores the parts that a magnitude of 3 or less.

Code:


Also I am aware that BodyForce is deprecated, I will fix this in the future.

I’m not sure what else to do, I’ve tried everything and nothing seems to work. If anyone knows why this may be happening please let me know, thank you!

1 Like

Nevermind, I just tried a different technique and it worked well. Not sure why this issue was occurring but it’s fixed now.

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