Posted February 12, 20223 yr Hey guys. Brand new to modding, but I've been having an issue trying to render my own custom model in place of the player. To render my player model, I've subscribed to the RenderPlayerEvent.Pre event and cancelled the default rendering process in place of my own. My custom model successfully renders into the world; however, I'm having an issue where my model constantly shakes. I've narrowed down the cause of the shaking to this line of code within LivingEntity#render float f = MathHelper.rotLerp(partialRenderTick, playerEntity.yBodyRotO, playerEntity.yBodyRot); My model's head's xRot value is dependent on that f value, but it seems the f value fluctuates due to the partial tick. In other words, my model can be completely standing still (having constant yBodyRot0 and yBodyRot values), but this function gives a different f value depending on the partial tick that's inputted into the function. This leads to my model "shaking" back and forth. I can set the partial tick to 0 in this function and it gets rid of the shaking; however, then my model is really only re-rendering every tick, which seems kind of choppy. I'm just sort of confused why this is happening to my custom model but not to the default player model. Obviously I'm missing something here, but I just can't put my finger on it. Any help would be greatly appreciated. Thanks!
February 12, 20223 yr I would imagine yBodyRoyO probably only gets update each tick. So if you're linear interpolating from yBodyRotO to yBodyRot more than once a tick, it would cause it to "rewind" and "replay" rapidly. Edited February 12, 20223 yr by bradsk88
February 12, 20223 yr Author Hmm that'd make sense, but it doesn't make sense to me how this issue doesn't affect the default player entity / model, since this code is a part of the default render process as well.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.