I've attached the code as text document because it wouldn't let me attach as anything else. I've attached the model hierarchy as well. Essentially, I have an overall model containing a "MovingPart" and the RigModel. I'm not a pro-character developer, more of a designer. To make it simple for myself is I create the character models animate them and place them in overall model. The script attached is supposed to play their animation loops, have the character rig model position and rotation match the MovingPart, and the MovingPart itself actually doing the pathfinding within the given bounds. Hopefully, I explained that correctly. The issue I am running into is: at a random time between 45 seconds and 4 minutes, all the parts inside the character rig completely delete. The MovingPart stays and still moves, the character model itself is there as well as the AnimationController, however, the literal parts themselves that make up the rig completely remove themselves from the game. Snap Just gone. This code was originally about 150 lines long. Debugged it 200. Got so overwhelmed trying to fix it that I ran it through Roblox AI Asst. -- pushed it to 250. Still nothing. Ran it through a AI coder -- pushed it to almost 400, and still no fix. Don't get me wrong, the script itself WORKS. The pathfinding works, rotation, movement, etc. The only issues I keep running into, is the character base parts themselves literally just self deleting. When I disable the Pathfinding in the script (making the characters static), the baseparts NEVER delete, so I'm just convinced it's something in this script with the movement that ends up being responsible for their deletion. I've double checked all my other scripts for any CleanUp or Destroy functions -- but nothing. I'm hoping maybe someone could explain something that maybe I'm missing. Is it the code? If not, should I look other places. The character rig does not contain a humanoid, so it's not dying or breaking joints.
#Scripted Character Rigs Keep Disappearing
1 messages · Page 1 of 1 (latest)
Anybody see anything wrong?
HOLY YAP
but let me try to see what's wrong
@next sequoia first of all you need to debug with print statements
so do some debugging and print statements for whenever the parts delete
also don't move the rig:PivotTo every heartbeat since it can cause physics or replication stress i thin
think*
oh and calling SetNetworkOwner(nil) and every frame CanCollide every heartbeat can result to being quite heavy
and may result in weird stuff too
try commenting out the per-frame block and instead run it once after you place the rig
finally, avoid calling rig:GetDescendants() every heartbeat for settings. frequent GetDescendants() can be expensive. Do it once or ocassionally
Mainly js add debugging
Thanks man, I'll see what I can do and yeah, holy YAP, lol I wanted to explain as close as possible cause I've been trying to figure this out for a week now
What would you suggest instead of every heartbeat?
i mean in most cases it's fine but if you do a lot of small movements then it could cause physics or replication
so i'd say you just change glueRigToMover() so it only runs when the pivot differs from the current by a threshold.
Oh that's smart, thanks bro!