Working with Angular Velocity
New to GS here.
I am trying to make a space ship game that uses some realistic space physics. The problem I'm having is with Angular Velocity. I did some research and there appears to be a bug with Angular Velocity, in that whenever that attribute is called, it returns the degrees per frame instead of the degrees per second.
Here is what I want to happen:
The player presses A, and the ship's rotation speed will begin accelerating in a counter clockwise direction.
The way that I thought I'd do that is to rotate counterclockwise at self.motion.angularVelocity+30 when A is down. If I understand how it works correctly, this should add 30 to the rotation speed every frame until the A key is released, effectively acceleration. I would do the same with the D key, but with clockwise instead. I believe this would simulate turning momentum. There would also be a max rotation speed constraint somewhere.
However, since self.motion.angularVelocity isn't returning correct values, this doesn't work.
What I need is some kind of work around. If there's a way to call the frames per second of the game, maybe that could be used to 'convert' the angular velocity from per frame to per second.
Anyone have any ideas?
One of the things I noticed was that the angular velocity was returning the correct value while the value was changing. You can notice this by using an interpolate behavior while displaying the angular velocity. Would it be feasible to constantly +1 and -1 to its value to pull a correct number?
I am trying to make a space ship game that uses some realistic space physics. The problem I'm having is with Angular Velocity. I did some research and there appears to be a bug with Angular Velocity, in that whenever that attribute is called, it returns the degrees per frame instead of the degrees per second.
Here is what I want to happen:
The player presses A, and the ship's rotation speed will begin accelerating in a counter clockwise direction.
The way that I thought I'd do that is to rotate counterclockwise at self.motion.angularVelocity+30 when A is down. If I understand how it works correctly, this should add 30 to the rotation speed every frame until the A key is released, effectively acceleration. I would do the same with the D key, but with clockwise instead. I believe this would simulate turning momentum. There would also be a max rotation speed constraint somewhere.
However, since self.motion.angularVelocity isn't returning correct values, this doesn't work.
What I need is some kind of work around. If there's a way to call the frames per second of the game, maybe that could be used to 'convert' the angular velocity from per frame to per second.
Anyone have any ideas?
One of the things I noticed was that the angular velocity was returning the correct value while the value was changing. You can notice this by using an interpolate behavior while displaying the angular velocity. Would it be feasible to constantly +1 and -1 to its value to pull a correct number?
Answers
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Personally I'd just lock the speed of rotation to the time the button is held.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS