Posted October 18, 20205 yr I've been trying to create a remote controlled entity, it's been going pretty well so far, though I have a single issue. To move the camera I've opted for how AbstractHorseEntity does it, copying the player's yaw and pitch values. This works fine until the yaw value reaches 360, upon which it abruptly snaps to about -90 and then returns to 0. Can anyone tell me what's causing this? The code for the entity can be found here. It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
October 18, 20205 yr 4 hours ago, Novârch said: Can anyone tell me what's causing this? Try moving the line prevRotationYaw = rotationYaw; below the line setRotation(rotationYaw, rotationPitch); You could also try overriding getYaw() to simply return rotationYaw, since getYaw() is what is used to determine the viewport yaw.
October 18, 20205 yr Author 15 minutes ago, vemerion said: You could also try overriding getYaw() to simply return rotationYaw, since getYaw() is what is used to determine the viewport yaw. This works, though it makes the rotation a heck of a lot less smooth. Nonetheless, thank you. It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
October 18, 20205 yr 14 minutes ago, Novârch said: This works, though it makes the rotation a heck of a lot less smooth. Nonetheless, thank you. Yes, the unfortunate side-effect of this solution is that it effectively reduces the update rate of the yaw rotation to 20 fps. A more sophisticated method might call super.getYaw() in most cases, and only resort to returning rotationYaw in the case when the rotation goes from 360 -> 0, or similar.
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.