So I’ve made a custom Character Model which includes a fake left and right arm, as well as a weapon. The problem I’ve encountered is that the model seems to lag behind slightly and I don’t know why.
I would provide a video/gif as an example, but for some reason it can’t be bothered to upload. I can however provide a code snippet:
Things I’ve tried that do not work:
- Using while true loop
- Using while wait loop
- Using Stepped
- Using RenderStepped
- Using Heartbeat
- Using BindToRenderStep
- Updating using via RemoteEvent
Small edit: “fakeInstance.Update()” just makes the Character Model move and requires it to be called every frame in order to update properly.
Why not just make these 2 fake arms a part of the character? Or maybe weld them or something
Because the way I built the weapon system is that it uses CFrames to animate the arms and weapon, and changing the Motors inside of the player’s Torso for the left and right arm create weird offsets.
I mean welding won’t be a problem or am I wrong?
Seems like the solution. Just rotate the welds
Edited to be more clear for anyone else reading this in the future with a similar issue
I believe the issue is the order of events here. When a frame is being rendered, here’s what’s happening:
You set the arms to the camera, and then the camera gets moved for that frame. This means that the arms are always “lagging” one frame behind.
To solve this, you’d use BindToRenderStep, and set the render priority parameter to something above 200 (which is the camera render priority). This way, you set the arms after the camera has been moved for that frame. That will have the arms in the right place for the current frame.
“Lag behind slightly.”
Where are you running your code? Server or the client? As well, what is going on in
fakeInstance.Update? If that function is expensive, then naturally it’d be slow too.
Doesn’t answer OP’s question. LocalTransparencyModifier is a multiplicative property on BaseParts for the client. That wouldn’t answer the question because the problem here is figuring out why CFrame updates to fake arms are causing lag.