This post is old and no longer being updated.
Maybe try attaching the motor6d’s on the server?
I don’t know the exact source of your problem. I assume its likely some problem with the model itself, as this script looks fine at first glance. Check welds or anchor perhaps, or if this is a client script then server.
However, one issue I noticed is this:
child:WaitForChild("BodyAttach", 1000)
Do not wait for “1000 seconds” Not only is this a completely unrealistic time, waitforchild should only be used when pre-defining things. Use findfirstchild, if it returns nil then either re-loop and wait or cancel totally. Waitforchild will not suddenly find an object 999 seconds later; it either does or doesn’t, and findfirstchild is a better way to say that.
Thanks for the reply. I’ve fixed my problem now so it’s all good. But with the “wait” thing, it’s just something I glossed over. My mistake. I’ll be more vigilant of these mistakes as I progress.
Solution no longer works for some reason? This issue is being very inconsistent and it’s driving me insane. I’ve tried attaching the joints client-side and server-side. I switch from one to the other until it eventually just stops working for some reason. Please help.
Okay so I tweaked a bit with your script and recommend you to try these suggestions instead:
- Try creating the Motor6D dynamically (via script) and not prepare it beforehand
- If the player is not going to interact with the tool at any instant, consider switching it for an accessory instead since they’re less janky
Just gave this a try. Same result. I also re-welded everything in the tool to see if that was the issue. I also made adjustments to the collision properties of each object. As far as tool interaction goes, it is a gun. And embedded within is a “check bullets” mechanic that ejects the magazine, so I would imagine just using an accessory is a no-go.