Jump to content

getCamera().moveYaw()


AresScripts

Recommended Posts

Havent tried it, maybe show us the code you are using? I might check it out in a minute.

private void checkCamera() {
		if (s.myPlayer().getRotation() == northRotation) {
			if (s.getCamera().getYawAngle() < 360 - 45
					&& s.getCamera().getYawAngle() > 45) {
				s.log("turn north");
				int number = s.random(360 - 45, 360 + 45);
				if (number > 360)
					number -= 360;
				s.getCamera().moveYaw(number);
			}
		}
		if (s.myPlayer().getRotation() == eastRotation) {
			if (s.getCamera().getYawAngle() < 45
					&& s.getCamera().getYawAngle() > 90 + 45) {
				s.getCamera().moveYaw(s.random(45, 90 + 45));
				s.log("turn east");
			}
		}
		if (s.myPlayer().getRotation() == southRotation) {
			if (s.getCamera().getYawAngle() < 90 + 45
					&& s.getCamera().getYawAngle() > 180 + 45) {
				s.getCamera().moveYaw(s.random(90 + 45, 180 + 45));
				s.log("turn south");
			}
		}
		if (s.myPlayer().getRotation() == westRotation) {
			if (s.getCamera().getYawAngle() < 90 + 45
					&& s.getCamera().getYawAngle() > 180 + 45) {
				s.getCamera().moveYaw(s.random(180 + 45, 360 - 45));
				s.log("turn west");
			}
		}
		s.getCamera().toTop();

	}
Link to comment
Share on other sites

private void checkCamera() {
		if (s.myPlayer().getRotation() == northRotation) {
			if (s.getCamera().getYawAngle() < 360 - 45
					&& s.getCamera().getYawAngle() > 45) {
				s.log("turn north");
				int number = s.random(360 - 45, 360 + 45);
				if (number > 360)
					number -= 360;
				s.getCamera().moveYaw(number);
			}
		}
		if (s.myPlayer().getRotation() == eastRotation) {
			if (s.getCamera().getYawAngle() < 45
					&& s.getCamera().getYawAngle() > 90 + 45) {
				s.getCamera().moveYaw(s.random(45, 90 + 45));
				s.log("turn east");
			}
		}
		if (s.myPlayer().getRotation() == southRotation) {
			if (s.getCamera().getYawAngle() < 90 + 45
					&& s.getCamera().getYawAngle() > 180 + 45) {
				s.getCamera().moveYaw(s.random(90 + 45, 180 + 45));
				s.log("turn south");
			}
		}
		if (s.myPlayer().getRotation() == westRotation) {
			if (s.getCamera().getYawAngle() < 90 + 45
					&& s.getCamera().getYawAngle() > 180 + 45) {
				s.getCamera().moveYaw(s.random(180 + 45, 360 - 45));
				s.log("turn west");
			}
		}
		s.getCamera().toTop();

	}

 

 

Just tested strictly the moveYaw method, it works, its slow and jerky and doesnt go to the exact angle, but it works (kinda).

Link to comment
Share on other sites

Lol k.  Not sure what im doing wrong then sad.png Its not that important though. Thanks for ur help!

 

 

Well there are 360 possible degrees in the circle (obviously) and by the looks of it, your code will only execute on 4 of those degrees. 

0, 90, 180, 270, or whatever you defined those 4 constants to be. 

Link to comment
Share on other sites

Well there are 360 possible degrees in the circle (obviously) and by the looks of it, your code will only execute on 4 of those degrees. 

0, 90, 180, 270, or whatever you defined those 4 constants to be. 

That has to do with what direction the player is facing. (north, south, east, and west)

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...