Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Look handler for boat
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
jmilthedude

Look handler for boat

By jmilthedude, June 30, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

jmilthedude    0

jmilthedude

jmilthedude    0

  • Tree Puncher
  • jmilthedude
  • Members
  • 0
  • 8 posts
Posted June 30, 2018 (edited)

Can anyone point me to how looking without affecting movement is handled? Like how the player can look around while moving in a boat?

 

EDIT: never mind the horse.. it moves the direction you move the mouse. I forgot.

 

Edited June 30, 2018 by jmilthedude
  • Quote

Share this post


Link to post
Share on other sites

jmilthedude    0

jmilthedude

jmilthedude    0

  • Tree Puncher
  • jmilthedude
  • Members
  • 0
  • 8 posts
Posted July 1, 2018

I might need to be more clear in my intent. I want to control the camera without changing the orientation of the body. So if you are walking straight, and you mvoe the mouse, you will continue to walk straight but the camera will change direction.

  • Quote

Share this post


Link to post
Share on other sites

jmilthedude    0

jmilthedude

jmilthedude    0

  • Tree Puncher
  • jmilthedude
  • Members
  • 0
  • 8 posts
Posted July 1, 2018

Talking to myself :) but this gets close to what I want..

	@SubscribeEvent
	public static void controlCamera(CameraSetup e) {
		if (keyPressed == true) {
			if (e.getEntity() instanceof EntityPlayer) {
				e.setPitch(Mouse.getY());
				e.setYaw(Mouse.getX());
			}
		}
	}

 

The problem is that it is based on the pixels of x and y. I need to figure out how to get it to match the player's sensitivity and also apply clamping properly.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      The game crashed whilst rendering overlay

      By diesieben07 · Posted just now

      In the future please make your own thread instead of posting in an old, unrelated thread.   Delete this file.
    • FactionsFire
      Exit code 0 Sorry for inconvenience

      By FactionsFire · Posted 2 minutes ago

      I am trying to lanuch 1.8.9 forge and i get "An unexpected issue happened and the game has crashed exit sorry for inconvenience exit code 0"" And this has happened for about a week. 
    • Merken
      The game crashed whilst rendering overlay

      By Merken · Posted 6 minutes ago

      The game crashed whilst rendering overlay Error: net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file forge-client.toml of type CLIENT for modid forge Exit Code: -1
    • Merken
      The game crashed whilst rendering overlay

      By Merken · Posted 10 minutes ago

      The game crashed whilst rendering overlay Error: net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file forge-client.toml of type CLIENT for modid forge Exit Code: -1
    • diesieben07
      My game keeps crashing

      By diesieben07 · Posted 1 hour ago

      You do not. In the future please make your own thread instead of posting in some random thread that looks vaguely similar.   Your Optifine version is outdated and not listed as compatible with your version of Forge. Refer to the Optifine downloads page regarding compatibility with Forge.
  • Topics

    • Merken
      2
      The game crashed whilst rendering overlay

      By Merken
      Started 10 minutes ago

    • FactionsFire
      0
      Exit code 0 Sorry for inconvenience

      By FactionsFire
      Started 2 minutes ago

    • seekR4621
      1
      My game keeps crashing

      By seekR4621
      Started 1 hour ago

    • NorthWestWind
      2
      [1.16.x] Stop Held Item blobbing in Hand

      By NorthWestWind
      Started 2 hours ago

    • ehbean
      1
      1.16.x Custom Furnace/Brewing Stand

      By ehbean
      Started 11 hours ago

  • Who's Online (See full list)

    • rhinitis
    • Merken
    • BossMoussedu75
    • JackRaidenPH
    • diesieben07
    • brandon3055
    • JustDoom
    • IntentScarab
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Look handler for boat
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community