Retrieve camera change of angle/pitch

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Apeirogon
Posts: 1606
Joined: Mon Jun 12, 2017 12:57 am

Retrieve camera change of angle/pitch

Post by Apeirogon »

How, and can I, detect how much player camera change it angle and/or pitch from previous position?
User avatar
Caligari87
Admin
Posts: 6190
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Retrieve camera change of angle/pitch

Post by Caligari87 »

Simple example you can put in your player class, just to see how it works.

Code: Select all

double oldAngle;
override void Tick() {
    super.Tick();
    double angleChange = DeltaAngle(angle, oldAngle);
    console.printf("%f", angleChange);
    oldAngle = angle;
}
Same can be done for pitch.
User avatar
Apeirogon
Posts: 1606
Joined: Mon Jun 12, 2017 12:57 am

Re: Retrieve camera change of angle/pitch

Post by Apeirogon »

Argh...
I dont mention that this is for UI render overlay event.

Download this, run and summon spectre.
viewtopic.php?p=1061257#p1061257
Problem is that if you try to furiously move mouse from side to side with spectre on screen, "shader frame"...mmmmm glitch a little. And I dont know how fix it.

Return to “Scripting”