So I'm trying to implement Pitch and Roll flight controls in Garrys Mod. My attempts up until now have been unsuccessful, which were using Player:GetAimVector():Angle() and setting the Entity's Pitch to the input pitch and roll to the Yaw of said input. Roll works fine however, I cannot seem to get Pitch to work properly when rotated. Any one have any ideas?
[QUOTE=Ronon Dex;47697886]So I'm trying to implement Pitch and Roll flight controls in Garrys Mod. My attempts up until now have been unsuccessful, which were using Player:GetAimVector():Angle() and setting the Entity's Pitch to the input pitch and roll to the Yaw of said input. Roll works fine however, I cannot seem to get Pitch to work properly when rotated. Any one have any ideas?[/QUOTE]
You need to add a special angle. Don't ask me this angle, it depends on the Model the player have. You need to find out what angle should be added to correct Pitch/Yaw.
Controlling a flight model with mouse input is heavily tied to the flight model itself. How are you handling the plane movement today?
I've actually managed to achieve my pitch/roll system now by using AddAngleVelocity however, after a while the entity starts to drift on the Y axis.
[QUOTE=Ronon Dex;47701992]I've actually managed to achieve my pitch/roll system now by using AddAngleVelocity however, after a while the entity starts to drift on the Y axis.[/QUOTE]
If you're not gonna use proper flight physics you might as well use ( vector1 - vector2 ):GetNormalized():Angle() and substitute Roll with the angle difference on the yaw axis between EyeAngles and Airplane body.
Sorry, you need to Log In to post a reply to this thread.