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"

Override OnMovementModeChanged causes Jump lag

I have overwritten OnMovementModeChanged function found in CharacterMovementComponent. The issue is that whenever the code is used, it causes a delay with the in-engine jump function.

For example, whenever the code is compiled and used, I have to push the jump button twice before I can jump again. Even if I wait several seconds before pushing the jump button, it still requires me to push it twice.

I know the code is the issue because when I take the code out and recompile, I can push the jump button as soon as the character lands, and the character will jump again.

Perhaps I didn't override it correctly?

Header File:

virtual void UCharacterMovementComponent::OnMovementModeChanged(EMovementMode PreviousMovementMode, uint8 PreviousCustomMode) override;

C++ File:

void AClassName::OnMovementModeChanged(EMovementMode PreviousMovementMode, uint8 PreviousCustomMode) { PrevMovementMode = PreviousMovementMode; }

Product Version: UE 4.20
Tags:
more ▼

asked Sep 14 '18 at 08:54 PM in C++ Programming

avatar image

Slavical
8 3 4 9

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

1 answer: sort voted first

Alright, so after so more research, I found my answer. The issue was that I didn't call the super when I over wrote the OnMovementModeChanged function.

.h file

 virtual void AMyClassName::OnMovementModeChanged(EMovementMode PrevMovementMode, uint8 PreviousCustomMode) override;

C++ file

 void AMyClassName::OnMovementModeChanged(EMovementMode PrevMovementMode, uint8 PreviousCustomMode)
 {
     Super::OnMovementModeChanged(PrevMovementMode, PreviousCustomMode);
     
     /* Your logic goes here */
 }

Do the following and you will have no issues creating your own logic or setting variables (like getting the previous movement mode).

more ▼

answered Oct 05 '18 at 04:48 PM

avatar image

Slavical
8 3 4 9

(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