x

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"

Basic hover mechanic?

Hi all, I want to give my character in the third person template the ability to hover in the air by the press of a button. By hover I mean stay in the same place after the button is clicked and when said button is released you fall to the ground. could somebody start me of in the right direction I have no idea where to start on this.

Thanks in advance.

Product Version: Not Selected
Tags:
more ▼

asked Oct 22 '14 at 06:36 AM in Blueprint Scripting

avatar image

Box0fnoobs
6 2 3 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

you could turn off gravity for your character and set the characterMovementComponent's velocity's Z value to 0 when the key is held. then on release of the key, you can turn on gravity.

more ▼

answered Oct 22 '14 at 04:51 PM

avatar image

ScottSpadea
9.5k 317 204 449

avatar image Box0fnoobs Oct 27 '14 at 09:59 AM

could I have this in a screenshot? so when x key is pressed apply no gravity and when said key is released reapply gravity. I don't understand what this characterMovementComponent you speak of is?

-edit: what I mean is I cant find characterMovementComponent

avatar image ScottSpadea Oct 30 '14 at 03:19 PM

if you go to edit > project settings > maps and modes

and look for defaultCharacter it will show the name of the character blueprint your game is using. it will probably be called myCharacter if you haven't changed it. you can search for that blueprint, open it, dock it to the toolbar. then inside the variables list, click on "show inherited variables" , and under character you can find characterMovement. drag that into the working area of the graph and click "Get". from the variable reference node that appears, drag out a line and in the search box type "get velocity" and click on the item in the list to get its velocity.

then switch tabs on the top right to the components tab and notice you have the same characterMovement variable in your components list. clicking on that gives you a list of the default values for your character's movement, like how fast you walk or how much you can control your fall.

alt text

avatar image R-K-J-S Dec 17 '14 at 03:12 PM

Could I ask how you managed to make a Gravity Scale variable? Is it related to the Character Movement value?

avatar image ScottSpadea Dec 17 '14 at 06:00 PM

GravityScale, just like Velocity, is a property of CharacterMovement, so to see it on the list of options, you should drag a line off of a CharacterMovement variable reference and search for gravity.

avatar image Box0fnoobs Oct 31 '14 at 09:04 AM

Thank you so much for a very in depth walkthrough, as a UE4 virgin this helped me out heaps.

(comments are locked)
10|2000 characters needed characters left
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