Jump to content
massih

Need help with camera angle.

Recommended Posts

I'm trying to position my camera angle to specific angle (pitch26, angle350)

 

But when i use:

			if (camera.getPitchAngle() != 26){
				camera.movePitch(26);
			}

it just moves the camera 26 degrees but not to 26 degrees..

and if i change it to:

			while (camera.getPitchAngle() != 26){
				camera.movePitch(1);
			}

it just laggs alot

Link to comment
Share on other sites

I'm trying to position my camera angle to specific angle (pitch26, angle350)

 

But when i use:

			if (camera.getPitchAngle() != 26){
				camera.movePitch(26);
			}

it just moves the camera 26 degrees but not to 26 degrees..

and if i change it to:

			while (camera.getPitchAngle() != 26){
				camera.movePitch(1);
			}

it just laggs alot

it lags alot because its stuck in a while loop. try adding a break.

Link to comment
Share on other sites

I'm trying to position my camera angle to specific angle (pitch26, angle350)

 

But when i use:

			if (camera.getPitchAngle() != 26){
				camera.movePitch(26);
			}

it just moves the camera 26 degrees but not to 26 degrees..

and if i change it to:

			while (camera.getPitchAngle() != 26){
				camera.movePitch(1);
			}

it just laggs alot

 

it wont move to 26 exactly as that is botlike. do not use a while loop for this, it will only cause issues: lag in your instance.

 

use boundaries instead like: 

if (camera.getPitchAngle() < 20 || camera.getPitchAngle() > 30)
    camera.movePitch(26);
	
Link to comment
Share on other sites

 

it wont move to 26 exactly as that is botlike. do not use a while loop for this, it will only cause issues: lag in your instance.

 

use boundaries instead like: 

if (camera.getPitchAngle() < 20 || camera.getPitchAngle() > 30)
    camera.movePitch(26);
	

 

i need it to be 26 +- 1 so 25 or 27 is okay.

I'm using this for a range guild script.

 

Is there any way i could align the target(rsobject) with mouse coordinations?

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.

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...