Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

  ------------------ higher height

`---------------------------------- Fixed Height

  ------------------ lower height

Like this.

So How can I script these things?

Product Version: UE 4.12
more ▼

asked Jun 07 '16 at 05:19 AM in Using UE4

avatar image

14 4 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey arrietty!

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! :)

more ▼

answered Jun 07 '16 at 07:35 AM

avatar image

701 28 8 51

avatar image ARRIETTY Jun 07 '16 at 07:58 AM

Thank you so much :)

avatar image Derzo Jun 07 '16 at 08:00 AM

Np! Also.. Would ya be so kind to add some karma, trying to get the badge this week? ;)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question