Model corrupted by tweenservice

I need move a Model (NPC) quickly, and I use TweenService to achieve this. However, using TweenService to frequently move the Model will cause the Model be destroyed
It’s been there for a long time and hopefully it will be fixed soon

OS:Win10 22H2

CFrameTest.rbxl (71.8 KB)
Dingtalk_20230918171953

Expected behavior

The model is moved and will never be destroyed

A private message is associated with this bug report

2 Likes

Tested it out, and something in the original post is slightly misleading:

The model is not actually destroyed - instead, it is teleported down to -(2^128) (340282346638528859811704183484516925440)
image


Edit1:
Issue relates to CFrame.new(startPos, targetPos). Something about targetPos breaks it. Could be a case of bad code.


1 Like

FWIW I double checked the position values being sent to the tween and they were all sane.

1 Like

OK, found the actual issue:
It’s not so much a Roblox issue rather an oversight in your code.

The issue occurs when the targetPos position is the same as the start position in

CFrame.new(startPos, targetPos)

hence causing the rotation to error.


This correlation can be seen here, where the orange text is startPos and the white text is targetPos
image
The moment they become equal, it completes one more cycle (with glitchy numbers due to the lookat being the same as the initial position), then errors.

2 Likes

I just want to add that the reason why parts are destroyed is that such a large negative value is below the ‘FallenPartsDestroyHeight’ setting in the workspace.