Jump to content

Need help with camera angle.


Recommended Posts

Posted

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

Posted

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.

Posted

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);
	
Posted

 

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?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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