How to fix a z axis value of character?
Hi there :)
I'm going to make a airplane(Character) fly in specific height(z axis).
and Sometimes I wanna make it fly little lower and also higher than the fixed height.
`---------------------------------- Fixed Height
So How can I script these things?
asked Jun 07 '16 at 05:19 AM in Using UE4
First of all, you shouldn't be using character class for an airplane, unless you are doing some kind of transformers game. Use pawn instead.
So when you go up/down with the plane, will it eventually come back to the fixed height? I assume so.
You need to have input axis up/down to add force. ForceZ = InputAxis×Speed*GetWorldDeltaS
Note: speed MUST be really, REALLY high value, something like 10 million. Experiment with it.
To get it back to fixed height, on tick, also add force. ForceZ = (0-LocationZ)×GetWorldDeltaS×GetBackSpeed
Notes: GetBackSpeed needs to also be really high value and the pawn Z world location must be 0.
Hope this helps, cheers! :)
answered Jun 07 '16 at 07:35 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here