How to apply constant forces on player characters

Kanoue_Yuuma
Sun, 19 Jul 2015 15:19:06 +0000
World Creation

Hello. I would like to apply some continuously changing forces on the player character in order to simulate flight but I can’t get it to work perfectly. I tried to do it by applying the net force on the character during each tick. This was done by dividing the net force by the mass of the player character and adding the resulting acceleration*time per frame to the current velocity. This seems to work well until the character touches the ground, which causes the falling animation to freak out. Also If the character hits a jump pad or anything that changes the velocity by launching the character, there seems to be no effect. I feel like there is a better way to doing this but apply force doesn’t seem to work on player characters since they are not static.

Attached are images of the entire aerodynamics script, close ups of the individual parts and the initialized values used in the calculations.

http://puu.sh/j4TSl/9eb2bf9dc8.png

http://puu.sh/j4TVG/e40741f254.png

http://puu.sh/j4TY0/0d8080d294.png

http://puu.sh/j4TZu/8a445b1cfa.png

http://puu.sh/j4U1z/b253d81eda.png

http://puu.sh/j4U2O/e76c451f80.png

http://puu.sh/j4U4T/c4db5a2b9e.png

2 posts - 1 participant